Assignemnt #59
Code
/// Name: Daniel Nguyen
/// Period: 6
/// Program Name: Monte Program
/// File Name: Monte.java
/// Date Finished: 9/9/2015
import java.util.Random;
import java.util.Scanner;
public class Monte
{
public static void main ( String[] args )
{
Scanner keyboard = new Scanner(System.in);
Random r = new Random();
int rng = 1 + r.nextInt(3);
int guess;
System.out.println("Guess which one the ace is!");
System.out.println(" ### ### ###");
System.out.println(" ### ### ###");
System.out.println(" ### ### ###");
System.out.println(" 1 2 3");
guess = keyboard.nextInt();
if (guess == rng) {
System.out.println("Congrats!! You got it!!!");
}
else {
System.out.println("NOOB! YOU LOST!!! The ace was in card number " + rng + ".");
}
if (rng == 1) {
System.out.println(" +-+ ### ###");
System.out.println(" |A| ### ###");
System.out.println(" +-+ ### ###");
System.out.println(" 1 2 3");
}
if (rng == 2) {
System.out.println(" ### +-+ ###");
System.out.println(" ### |A| ###");
System.out.println(" ### +-+ ###");
System.out.println(" 1 2 3");
}
if (rng == 3) {
System.out.println(" ### ### +-+");
System.out.println(" ### ### |A|");
System.out.println(" ### ### +-+");
System.out.println(" 1 2 3");
}
}
}
Picture of the output