Programming Assignment #59
Code
/// Name: Dylan Sleeper
/// Period: 6
/// Program Name: Monte
/// File Name: Monte.java
/// Date Finished: 10/22/2015
import java.util.Scanner;
import java.util.Random;
public class Monte{
public static void main(String[] args){
System.out.println("Guess which one the ace is!");
System.out.println();
System.out.println(" ### ### ### ");
System.out.println(" ### ### ### ");
System.out.println(" ### ### ### ");
System.out.println(" 1 2 3 ");
System.out.println();
int g = new Scanner(System.in).nextInt();
System.out.println();
int num = new Random().nextInt(2) + 1;
if(g == num){
System.out.println("You got it! That's crazy!");
}
else{
System.out.println("Nope, that's not the ace. Bummer.");
}
System.out.println();
if(num == 1){
System.out.println(" +-+ ### ### ");
System.out.println(" |A| ### ### ");
System.out.println(" +-+ ### ### ");
System.out.println(" 1 2 3 ");
}
else if(num == 2){
System.out.println(" ### +-+ ### ");
System.out.println(" ### |A| ### ");
System.out.println(" ### +-+ ### ");
System.out.println(" 1 2 3 ");
}
else if(num == 3){
System.out.println(" ### ### +-+ ");
System.out.println(" ### ### |A| ");
System.out.println(" ### ### +-+ ");
System.out.println(" 1 2 3 ");
}
}
}
Outputs