Assignemnt #71: Shorter Dice Doubles
Code
/// Name: Kelsey Lieberman
/// Period 5
/// Program Name: ShorterDiceDoubles
/// File Name: ShorterDiceDoubles.java
/// Date Finished: 12/11/2015
import java.util.Random;
public class ShorterDiceDoubles
{
public static void main(String[] args) throws Exception
{
Random r = new Random ();
int x = 1 + r.nextInt(6), z = 1 + r.nextInt(6);
System.out.println("HERE COMES THE DICE...");
Thread.sleep(1000);
System.out.println("AAAUUGGHHHHHHHHHHH");
Thread.sleep(1000);
do
{
x = 1 + r.nextInt(6);
z = 1 + r.nextInt(6);
System.out.println("First roll: "+x);
Thread.sleep(100);
System.out.println("Second Roll: "+z);
Thread.sleep(100);
System.out.println("The total is " + (z+x) + "!");
Thread.sleep(100);
} while (z != x);
}
}
Picture of the output