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