Assignment #59 Three Card Monte
Code
/// Name: Lacey Reese
/// Period: 5
/// Program Name: ThreeCardMonte
/// File Name: ThreeCardMonte.java
/// Date Finished 11/25/2015
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 Ace = 1 + r.nextInt(3);
System.out.println( "You slide up tp Fast Eddie's card table and plop down your cash" );
System.out.println( "He glances down at you at the corner of his eyes and starts shuffling." );
System.out.println( "He lays down 3 cards." );
System.out.println();
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( "> " );
int choice = keyboard.nextInt();
System.out.println();
if ( choice == 1 )
{
System.out.println( "You guessed it right!! Winner winner chicken dinner!!" );
}
else if ( choice > 2 )
{
System.out.println( "Sorry bud I get all your money! CHA CHINGGGG" );
}
else if ( choice < 3 )
{
System.out.println( "HEHEHE everytime I get your money dude." );
}
else
{
System.out.println( "You suck at this game." );
}
System.out.println();
if ( Ace == 1 )
{
System.out.println( " ## ## ## " );
System.out.println( " ## ## ## " );
System.out.println( " Ace 2 3 " );
}
else if ( Ace == 2 )
{
System.out.println( " ## ## ## " );
System.out.println( " ## ## ## " );
System.out.println( " 1 Ace 3 " );
}
else if ( Ace == 3 )
{
System.out.println( " ## ## ## " );
System.out.println( " ## ## ## " );
System.out.println( " 1 2 Ace " );
}
}
}
Picture of the output
//