Fortune
Code
import java.util.Random;
public class Fortune
{
public static void main ( String[] args )
{
Random r = new Random();
int choice = 1 + r.nextInt(6);
String response = "";
if ( choice == 1 )
response = "i sense a bad luck coming for you";
else if ( choice == 2 )
response = "Good luck is coming your way";
else if ( choice == 3 )
response = "You are a great fool";
else if ( choice == 4 )
response = "Eat more carrots";
else if ( choice == 5 )
response = " Never look behind you when its dark";
else if ( choice == 6 )
response = "You will find what you were looking for";
System.out.println( response );
int x = 1 + r.nextInt(54);
System.out.print( 1 + r.nextInt(54) + "\t" );
System.out.print( 1 + r.nextInt(54) + "\t" );
System.out.print( 1 + r.nextInt(54) + "\t" );
System.out.print( 1 + r.nextInt(54) + "\t" );
System.out.print( 1 + r.nextInt(54) + "\t" );
System.out.print( 1 + r.nextInt(54) + "\t" );
System.out.println();
}
}
Fortune