Someone advice me on what functions to use?

closed account (EApGNwbp)
CLOSED
Last edited on
closed account (3CXz8vqX)
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.
closed account (EApGNwbp)
@ravenshade thanks, but it's a requirement of the assignment to use functions...
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.
closed account (3CXz8vqX)
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.
closed account (EApGNwbp)
What do you guys suggest I have in the main function?

Thanks for all your suggestions
closed account (3CXz8vqX)
*cries*

Why why does cin.get() no work!

Anyway, here's a hint
1
2
3
4
5
    if( !check_continue() ) 
		{
			run = check_victor( player1_total, player2_total );
			if( run == false ) return 0;
		}
Topic archived. No new replies allowed.