Now, I think you should write a method that asks the user which dice to keep. We will worry about how to re-roll the other dice after you get that method finished.
Layne
Originally posted by Layne Lund:
That's a great start. One comment: you can combine the first two lines into a single one. Also, you can put these few lines of code into a single method, say rollDice(). What will its return value and parameters be? Next, write a method that asks the user to enter which dice to keep. You can write yet another method to actually reroll the other dice, but worry about that later. When you get that far, post the whole class and we can keep helping you from there.
Layne
[ January 24, 2006: Message edited by: Layne Lund ]
Originally posted by Jim Yingst:
Understood. It's going to be hard if you try to replace the whole method at once, so I think you'll probably be better of sticking with the new short bit of code you just wrote, and "growing" it to gradually do all the things you wanted the original code to do.
So, what does this method (the short one you just wrote) print out? Does it print the same thing every time? Is there a way to can midify the code so that the results are random, like you're "rolling" the dice?