Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Random randomize = new Random();
- boolean allTrue = false;
- int cont = 0;
- do{
- int dice1 = randomize.nextInt(6) + 1;
- int dice2 = randomize.nextInt(6) + 1;
- int dice3 = randomize.nextInt(6) + 1;
- if(dice1 == dice2 && dice1 == dice3)
- {
- allTrue = true;
- }
- cont ++;
- }while(allTrue == false);
- System.out.println(cont);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement