package edu.bloomu.ch5a;

import java.util.concurrent.ThreadLocalRandom;

/**
 * Simulates the first roll in the game of Craps. The player rolls two dice. A sum of 7
 * wins and a sum of 2, 3, or 12 loses; in any other case, the game continues.
 *
 * @author Drue Coles
 */
public class FirstRollWithSwitch {

    public static void main(String[] args) {
        ThreadLocalRandom rand = ThreadLocalRandom.current();
        int die1 = rand.nextInt(1, 7);
        int die2 = rand.nextInt(1, 7);
        int sum = die1 + die2;

        System.out.println(die1 + " + " + die2 + " = " + sum);

        switch (sum) {
            case 2:
                System.out.println("YOU LOSE.");
                break;
            case 3:
                System.out.println("YOU LOSE.");
                break;
            case 7:
                System.out.println("YOU WIN.");
                break;
            case 11:
                System.out.println("YOU WIN.");
                break;
            case 12:
                System.out.println("YOU LOSE.");
                break;
            default:
                System.out.println("The game continues.");
        }
    }
}