Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. Random randomize = new Random();
  2. boolean allTrue = false;
  3. int cont = 0;
  4.  
  5. do{
  6.  
  7. int dice1 = randomize.nextInt(6) + 1;
  8. int dice2 = randomize.nextInt(6) + 1;
  9. int dice3 = randomize.nextInt(6) + 1;
  10.  
  11. if(dice1 == dice2 && dice1 == dice3)
  12. {
  13. allTrue = true;
  14. }
  15.  
  16. cont ++;
  17.  
  18. }while(allTrue == false);
  19.  
  20. System.out.println(cont);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement