Project
Create a simple (text, no graphics) game based on Craps.
(see the Wikipedia link below.)
Game Rules
- At the start of the game, the player is asked for their name.
(Their name should be used whenever the game
displays a message.)
- At the beginning of the game the player is given $10,000
to place wagers (bets) with.
- At each pass through the game, the player is asked
if they want to continue or quit.
- The player wagers (bets) an amount from the
the amount of money they have.
(obviously they can not wager more than they have.)
- If the player wins, they receive two times their wager (bet).
- If the player looses, they loose their wager (bet).
- The player rolls two dice.
- The sum of the dice is their number point.
- A pass through the game consists of rolling the dice until the player
wins, looses, or quits (which is loosing).
- On the first roll of the dice
- If the player rolls 7 or 11 they win
- If the player rolls 2, 3, or 12 they loose
- Any other number becomes their number point for further rolls
- On the second, third, ... rolls
- If the player rolls their number point, they win
- If the player rolls 7 or 11 they loose
- Any other number, the player rolls again
- After the player wins or looses, they as asked
if the want start another pass though the game or quit.
- A the end of the game the amount of money the player has
is displayed. If the money exceeded the players initial amount
congratulate them ("Congratulations name
you have won $????? dollars"). If the player lost money console them
("Sorry you lost").
Hint
At any time the player should be able to ask for the state of the game.
At a minimum, the following should be displayed:
- The players name
- How much money the player has
- The amount of the current wager (bet), if any
- The player's number point, if any
When the dice are rolled, their values are randomly chosen.
(Note: Each die's value is randomly selected, 1-6)
To increase dramatic effect, pause after each roll of the dice
(1 or 2 second?) before displaying the dice values.
Various messages could be displayed after each roll of the dice.
See the Wikipedia article for more information.
Craps (Wikipedia)