Roulette Specification
Write a program to simulate a game of roulette. In roulette, a wheel spins and yields a number between 1 and 36 when a ball drops into a numbered slot. There are also slots numbered 0 and 00. These slots are green and each of the other slots is red or black. Additionally, 0 and 00 are not considered either even or odd, nor high or low.
In Las Vegas style rules, gamblers can make several different kinds of bets, each of which pays off differently as listed in the table below. These payoffs are close to the real mathematical odds of getting such a spin, but slightly lower to allow the casino to make a profit on average.
Bet | Payoff |
---|---|
Red/Black | 1 to 1 |
Odd/Even | 1 to 1 |
High/Low | 1 to 1 |
Single number | 35 to 1 |
Two consecutive numbers | 17 to 1 |
Three consecutive numbers | 11 to 1 |
For the consecutive number bets, the user can bet on a number (e.g., 18) and then if the ball lands in either that number or the number one (or two, for the three consecutive bets) higher (e.g., 18 or 19), the user wins.
If the gambler wins, the original bet is not lost and the gambler is awarded a payoff according to the bet's odds. A payoff with odds of 1 to 1 pays even money: a bet of $10.00 earns the gambler $10.00 if the bet wins. On the other hand, a payoff of 17 to 1 means that a bet of $10.00 earns the gambler $170.00. If the gambler loses, no money is paid out and the bet is kept by the casino.
Input/Output
Your program should prompt the user for an initial amount of money to bet, the user's bankroll. The user should then be given the opportunity to make one of six different bets (listed in the table above). The current program only implements three of the six bets; you must update those bets and add three additional types of bets. Initially you should present the user with a menu similar to the list below:
- bet on red or black
- bet on high or low (low is 1 -- 18, high is 19 -- 36)
- bet on a specific number
Then, for each bet, you should prompt the user for information specific to that bet. For example, if the user chooses to bet on a specific number, you should prompt the user to enter the number. It is fine to represent the number "00" as "37".
The user should be allowed to bet any positive amount not exceeding the bankroll. After each bet, the bankroll should be updated appropriately and the new total reported to the user. If the user runs out of money, the program should stop.