0
I need help
The program I'm making asks the user how many players are going to play(4 max)and then with how many money they count. At the end, they launch 3 dices and the way of winning is: If I have 3 same numbers. I win. If not, at least I have to have 2 same numbers. If not, I have to search who has the most biggest numbers. My problem is how do I make the win? If I have 111 but my friend has 222 he wins. If I have 113 and my friend 112 I win. Basic program; I understand how to use FOR, and sets (iostream stdlib)
2 Answers
- 1
I'd make 3 methods-one for each of the three ways you said a person could win.
In the main method, you could call each of the three methods in nested if statements.
For Example:
if(threeSame)
//The methods should return a boolean, stating whether a person has three same, and if so, calls another method which would see who has 3 of the same
else if(twoSame)
//The same as above
else if(biggestNum)
// The same as the first
0
That is a good start,
Thanks a lot.
đ