import objectdraw.*; import java.util.Random; public class DiceMax extends FrameWindowController { private static final int MAX_DIE_VALUE = 6; private Random diceRoller = new Random(); // roll the die until you get a 6 and print each roll public void onMousePress(Location loc) { System.out.println(); int dieRollResult; do { dieRollResult = diceRoller.nextInt(MAX_DIE_VALUE) + 1; System.out.println("got a " + dieRollResult); } while (dieRollResult != MAX_DIE_VALUE); } }