Assignemnt #59 - Card
Code
/// Name: Caelan Dorstad
/// Period: 6
/// Program Name: Card
/// File Name: Card.java
/// Date Finished: 10/30/2015
import java.util.Scanner;
import java.util.Random;
public class card{
public static void main(String[] args){
Scanner keyboard = new Scanner(System.in);
Random r = new Random();
int a, num = 1 + r.nextInt(3);
System.out.println("GUESS");
System.out.println();
System.out.println(" ## ## ##");
System.out.println(" ## ## ##");
System.out.println(" 1 2 3 ");
System.out.println();
System.out.print("> ");
a = keyboard.nextInt();
System.out.println();
if (a==num && num == 1){
System.out.println("You are CORRECT!");
System.out.println();
System.out.println(" AA ## ##");
System.out.println(" AA ## ##");
System.out.println(" 1 2 3 ");
}
else if (a==num && num==2){
System.out.println("You are CORRECT!");
System.out.println();
System.out.println(" ## AA ##");
System.out.println(" ## AA ##");
System.out.println(" 1 2 3 ");
}
else if (a==num && num == 3){
System.out.println("You are CORRECT!");
System.out.println();
System.out.println(" ## ## AA");
System.out.println(" ## ## AA");
System.out.println(" 1 2 3 ");
}
else {
System.out.println("it was " + num + " ! ");
System.out.println();
{ if (num == 1){
System.out.println(" AA ## ##");
System.out.println(" AA ## ##");
System.out.println(" 1 2 3 ");
}
else if (num == 2){
System.out.println(" ## AA ##");
System.out.println(" ## AA ##");
System.out.println(" 1 2 3 ");
}
else if (num==3){
System.out.println(" ## ## AA");
System.out.println(" ## ## AA");
System.out.println(" 1 2 3 ");
}
}
}
}
}
Picture of the output