Note: I love programming.
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Note: I love programming.
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Note: I love programming.
Originally posted by MrManuel:
Ok, so are u guys gonna help me, or just criticize my code?
Note: I love programming.
Note: I love programming.
Note: I love programming.
"I'm not back." - Bill Harding, Twister
Note: I love programming.
"I'm not back." - Bill Harding, Twister
Note: I love programming.
"I'm not back." - Bill Harding, Twister
Note: I love programming.
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?
Note: I love programming.
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 ]
Note: I love programming.
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
Note: I love programming.
Originally posted by Manuel Diaz:
Yes man, but thats the point, I can't get it done![]()
Originally posted by Layne Lund:
Sure you can. It just takes time and effort. In fact, you have already written the code in your original program that asks the user for the dice they want to keep. I'm just asking you to place this code in its own method in the new version we are working on here.
Layne
Note: I love programming.
Note: I love programming.
Originally posted by Manuel Diaz:
Oh sry I forgot to mention, that when I input the die to re roll, my program re rolls everysingle dice, Why this is happening??
Consider Paul's rocket mass heater. |