Assignemnt #59 Three Card Monte
Code
///Tyler HArt
///period 5
///Three Card Monte
///Monte.java
///11/12/2015
import java.util.Random;
import java.util.Scanner;
public class Monte
{
public static void main( String [] args)
{
Scanner key = new Scanner(System.in);
Random r = new Random();
int d1= r.nextInt(3)+1,d2;
System.out.println("Behind one of the doors is a copy of CKII with all the DLC exculding the newest one, behind the other two doors are Man eating Squirrels");
System.out.println("What door do you open?");
System.out.println("\t ## ## ##");
System.out.println("\t ## ## ##");
System.out.println("\t 1 2 3 ");
d2 = key.nextInt();
if (d1==d2)
{
System.out.println("You win the CKII CD key");
if (d1==1)
{
System.out.println("\t CK ## ##");
System.out.println("\t CK ## ##");
System.out.println("\t 1 2 3 ");
}
if (d1==2)
{
System.out.println("\t ## CK ##");
System.out.println("\t ## CK ##");
System.out.println("\t 1 2 3 ");
}
if (d1==3)
{
System.out.println("\t ## ## CK");
System.out.println("\t ## ## CK");
System.out.println("\t 1 2 3 ");
}
}
else if (d1!=d2)
{
System.out.println("I Hope you train in boxing.");
System.out.println("because you now own a man eating squirrel");
if (d1==1)
{
System.out.println("\t CK ## ##");
System.out.println("\t CK ## ##");
System.out.println("\t 1 2 3 ");
}
if (d1==2)
{
System.out.println("\t ## CK ##");
System.out.println("\t ## CK ##");
System.out.println("\t 1 2 3 ");
}
if (d1==3)
{
System.out.println("\t ## ## CK");
System.out.println("\t ## ## CK");
System.out.println("\t 1 2 3 ");
}
}
}
}
Picture of the output