Triple Roll Game
Problem Statement
Write a program that allows two players to play the game Triple Roll.
Analysis
The game of Triple Roll is played with two players and three dice.
Players take turns rolling the dice to generate a score.
Each player has a fixed number of turns (in this program three) and the
player with the highest cumulative score is the winner.
During a turn a player rolls all three dice. The player may then choose
one die to re-roll and try to get a better score. A player is not required
to re-roll a die.
The order of the dice does not matter. The scoring is as follows:
Kind of roll |
Score for roll |
Example roll |
Example score |
Straight |
4 * middle die value |
3 4 5 |
4 * 4 = 16 |
Three of a kind |
3 * die value |
5 5 5 |
3 * 5 = 15 |
Two of a kind |
2 * die value of pair |
3 4 4 |
2 * 4 = 8 |
None of the above |
1 * largest die value |
1 4 5 |
1 * 5 = 5 |
Note: A straight occurs when the die are in sequential order.
Design
Design documents include brief descriptions
of the pre-existing classes that will be used and more detailed descriptions
of the classes that will be written including data members and methods.
Coding
The code for the classes written for this game:
You'll also need the Die class.
Testing
Testing should be done as the code is written and also at the end.
You should test to make sure all the requirements have been met as well as
for unusual situations (such as unexpected user input).