Simple Craps Game

Project

Create a simple (text, no graphics) game based on Craps. (see the Wikipedia link below.)

Game Rules

  1. At the start of the game, the player is asked for their name.
    (Their name should be used whenever the game displays a message.)
  2. At the beginning of the game the player is given $10,000 to place wagers (bets) with.
  3. At each pass through the game, the player is asked if they want to continue or quit.
  4. The player wagers (bets) an amount from the the amount of money they have.
    (obviously they can not wager more than they have.)
  5. If the player wins, they receive two times their wager (bet).
  6. If the player looses, they loose their wager (bet).
  7. The player rolls two dice.
  8. The sum of the dice is their number point.
  9. A pass through the game consists of rolling the dice until the player wins, looses, or quits (which is loosing).
    1. 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
    2. 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
  10. After the player wins or looses, they as asked if the want start another pass though the game or quit.
  11. 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:

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)