Mar 6, 2013 at 2:37am UTC
CLOSED
Last edited on Mar 6, 2013 at 4:43am UTC
Mar 6, 2013 at 2:45am UTC
You're going to need a random number include.
That's about it though.
As for writing functions...I don't think you'll actually need any. Just use your loops wisely.
Mar 6, 2013 at 2:46am UTC
@ravenshade thanks, but it's a requirement of the assignment to use functions...
Mar 6, 2013 at 3:14am UTC
Some obvious choices for functions are
- Rolling the dice
- Checking for a winner
If the rules for both players are the same, then you should have a single function that handles one player at a time. Which player should be an argument to that function.
Mar 6, 2013 at 3:16am UTC
Ah...in that case...
You'll need a function to check whether you want to continue... if not, add up the scores and decide a winner.
You'll need a reset function, pass the params over ^_^
And if you're like me (who just blitzed the thing) you'll want a roll function too.
...it's the logic towards the end which is going to really annoy you, the adding up business. You could throw these into a function as well possibly.
Mar 6, 2013 at 3:23am UTC
What do you guys suggest I have in the main function?
Thanks for all your suggestions