Assignment #71 Shorter Double Dice

Code

    /// Name: Koosha Kimelman
    /// Period: 7
    /// Program Name: Shorter Double Dice
    /// File Name: ShorterDice.java
    /// Date Completed: 11/17/15
    
    import java.util.Random;
    
    public class ShorterDice {
    
        public static void main(String[] args) throws Exception {
        
            Random r = new Random();
            
            int r1, r2, total;
            
            System.out.println("Here are the dice rolls... again.");
            
            do {
                r1 = (1+r.nextInt(6));
                r2 = (1+r.nextInt(6));
                total = (r1+r2);
                
                Thread.sleep(400);
                System.out.println("\nRoll #1: " + r1);
                Thread.sleep(250);
                System.out.println("Roll #2: " + r2);
                Thread.sleep(250);
                System.out.println("The total is " + total);
            } while (r1 != r2);
        }
    }
    

Picture of the output

Assignment 71