Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DiceGame {
- public static void main(String[] args) {
- Die d1, d2;
- int counter = 0;
- d1 = new Die();
- d2 = new Die();
- while (!(d1.getNum() == 6 && d2.getNum() == 6)) {
- System.out.println(d1.getNum() + ":" + d2.getNum());
- d1.roll();
- d2.roll();
- counter++;
- }
- System.out.println(d1.getNum() + ":" + d2.getNum());
- System.out.println("counter = " + counter);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement