.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> OOPS >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Java Program for FLAMES Game.

Posted By:laptop charles       Posted Date: June 30, 2010    Points: 10    Category: OOPS    URL: http://www.dotnetspark.com  

It is a funny game using java.
 

Java flames game .
I used very simple concept for this game.
It just enter two string or two name then will match for some interesting
import java.io.*;
import java.lang.*; 
Class flames
{
  public static viod main(String arg[]) throws IO Exception
  {
    String a;
    String b;
    String fl="flames"
    int l,m,i,j,ii,jj,aaa=0,bbb=0,count,t,r;
    char aa[]=new char[30];
    char bb[]=new char[30];
    char f[]=new char[30];
Buffered Reader n=new Buffered Reader(new Input stream    reader(System.in));
System.out.println("Enter the First name");
a=n.readline();
System.out.println("Enter the Second name");
b=n.readline();

l=a.length();
m=b.length();
for(i=0;i0)
   { 
     aaa++;
   }
}
for(j=0;j0)
   { 
     bbb++;
   }
}
 Count =aaa+bbb;
for(i=1;i<=6;i++)
   {
     f[i]=fl.charAt(i-1);
   }
i=1;
for(t=0;t<5;t++)
  {
   For(r=1;r<=count;r++)
     {
        if(f[i]>0)
          { 	
		if(r==count)
		  {
		     f[i]=0;
		  }
	         if(i==6)
		  {
		     i=0;
		  }	
                     i++;
		  }
	        Else
		 {
		If(i==6)
		{
		i=0;
		}
		i++;
		r--;
		}
	   }
    }
 for(i=1;i<=6;i++)
  {
     Switch(f[i])
	{
	  case "f":
		system.out.println("Friend");
		break;
           case "l":
		system.out.println("Love");
		break;
            case "a":
		system.out.println("Affection");
		break;
            case "m":
		system.out.println("Marrage");
		break;
	   case "e":
		system.out.println("Enemy");
		break;
	   case "s":
		system.out.println("Sister");
		break;
	}
       }
    }
}




 result.

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend