Assignment #59
Code
///Name: Cody Swain
///Period: 6
///Project Name: ThreeCardMonte
///File Name: ThreeCardMonte.java
///Date: 11/13/15
import java.util.Scanner;
import java.util.Random;
public class ThreeCardMonte
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
Random r = new Random();
int x = 1 + r.nextInt(3);
int guess;
System.out.println( "You are in Josephs casino. Joseph lays down three cards.");
System.out.println( "Which one is the ace? " );
System.out.println();
System.out.println( " ## ## ## ");
System.out.println( " ## ## ## ");
System.out.println( " 1 2 3 ");
System.out.println();
System.out.print( " " );
guess = keyboard.nextInt();
if ( guess == x )
System.out.println( " Dank! That's correct. You get $ " );
else System.out.println( "HAHA NOPE! Sneaky Joseph got u maybe ur stoopd " );
System.out.println();
if ( x == 1 ){
System.out.println( " AA ## ## ");
System.out.println( " AA ## ## ");
System.out.println( " 1 2 3 ");
}
else if ( x == 2 ){
System.out.println( " ## AA ## ");
System.out.println( " ## AA ## ");
System.out.println( " 1 2 3 ");
}
else if ( x == 3 ){
System.out.println( " ## ## AA ");
System.out.println( " ## ## AA ");
System.out.println( " 1 2 3 ");
}
}
}
Picture of the output