Assignemnt #59 and Three Card Monte
Code
/// Name: Brian Phillips
/// Period: 5
/// Program name: Three Card Monte
/// File Name: ThreeCards.java
/// Date Finished: 12/3/2015
import java.util.Scanner;
import java.util.Random;
public class ThreeCards
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
Random r = new Random();
int choice = 1 + r.nextInt(3);
int hisNumber;
System.out.println("You pull out a wad of cash and lay it on the table");
System.out.println("Franko deals out 3 cards can you guess which card is the ace");
System.out.println("# # #");
System.out.println("# # #");
System.out.println("1 2 3");
hisNumber = keyboard.nextInt();
System.out.println();
if ( choice == hisNumber )
{
System.out.println( "Damn those are some great eyes. Number " + choice + " was the ace." );
}
if ( choice != hisNumber )
{
System.out.println( "Sorry my it was card " + choice + ". Better luck next time.");
}
}
}
Picture of the output