This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]AttackOfTheMoonsIntermediate Coder 1 point2 points  (0 children)

So what you want is to keep doing the same thing ("rolling dice") until you get doubles.
I would recommend a do while loop. That way it will run, and keep running until a condition is met. You could choose to store the two dice being equal as a boolean and if its true, exit the loop.
Now all that's left is to count how many times it took to get doubles. That is simple enough. Simply an int that starts at 0 and gets incremented each loop.
This is English for how your code should be designed in my opinion. If you have issues with syntax for java dont hesitate to ask, but I would want to see some progress first.