Code 4 Roulette

CODE 4 is a very simple method which was inspired by JohnLegends PATTERN 4. Its strength comes from combining dozens and columns CODE 4 DC aswell as EO and HL CODE 4 EC. EO/HL approach was established by Atlantis. It should only be played HIT AND RUN.

  • European Roulette has a rule known as “la partage.” This returns half of an even money bet if the ball lands on zero. This cuts the house edge on red/black, odd/even and hi/lo to 1.35%.
  • Roulette is a casino game in Fallout, Fallout 2 and Fallout: New Vegas. 1 Fallout and Fallout 2 1.1 Locations 1.1.1 Fallout 1.1.2 Fallout 2 2 Fallout: New Vegas 2.1 Rules 2.2 Betting 2.3 Examples 2.4 Playing to Win 2.5 Locations 2.6 Notes 3 Behind the scenes 4 Bugs 5 References Roulette can be played via dialogue in Fallout and Fallout 2 by speaking to roulette dealers in the following.
Code 4 roulette wheelFor this problem you will form groups of size three or four persons.You may not work alone! You should start each group activity by introducingyourself to each member of the group. You may also want to choose one person to write down the group'sdiscussion on the provided index cards as you go.

This project is intended to get you to practice some of the programming anddesign techniques discussed in class recently (i.e., using the open/closedprinciple to add flexibility to your code and building frameworks that allowothers to extend your code in specific ways).Your group should examine the code given and determine how to redesign it tomake the code simpler and more flexible. You should present your design usingCRC cards and as well as a class interaction diagram. After eachgroup is finished, you may be called on to defend your design in front of yourclassmates.

Specification

This program simulates a game of roulette. In roulette, awheel spins and yields a number between 1 and 36 when a ball drops into anumbered slot. There are also slots numbered 0 and 00. These slots are green andeach of the other slots is red or black. For the purposes of this program,assume that all odd numbers are black and all even numbers are red. In the realgame, the colors black and red are distributed differently, but we will ignorethat for the purposes of this program. Additionally, 0 and 00 are not consideredeither even or odd.

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. Thesepayoffs are close to the real mathematical odds of getting such a spin, butslightly lower to allow the casino to make a profit on average.

Bet
Red/Black
1 to 1
Odd/Even
Single number
35 to 1
Two consecutive numbers
Three consecutive numbers
11 to 1

A payoff of 1 to 1 pays even money: a bet of $10.00 earns thegambler $10.00 if the bet wins. On the other hand, a payoff of 17 to 1means that a bet of $10.00 earns the gambler $170.00. If the gamblerloses, 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, the user'sbankroll. The user should then be given the opportunity to make one of threedifferent bets, or to quit the program. You are required to implement the firstthree bets in the table above; you can implement the last two bets for one pointof extra credit each. Initially you should present the user with a menusimilar 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 thatbet. For example, if the user chooses to bet on a specific number, youshould prompt the user to enter the number. It is fine to represent thenumber '00' as '37'.

The first two bets pay even money: a bet of $5.00 earns $5.00 if the betwins. Winning a bet on a specific number pays 35 * b where b is the bet. Thus awinning bet of $4.00 earns $140.00. A winning bet earns back the money bet sothat betting $10.00 on red and winning means that you get back $20.00 --- theoriginal wager plus the even money winnings, or 10 + 10 = 20.

The user should be allowed to bet any positive amount not exceeding thebankroll. After each bet, the bankroll should be updated appropriately and thenew total reported to the user. If the user runs out of money, the programshould stop.

Current Code

Code 4 Roulette Games

Questions

Here are some questions you should consider in order to refactor the givencode:

Code 4 Roulette Game

  1. What would need to change in order to add a new kind of bet to the system?
  2. What would need to change in order to add a graphical user interface to the system (note, the particulars of how the GUI looks is not important in answering this question (why?))?
  3. What would need to change in order to support multiple players playing the same series of games?
  4. What would need to change in order to support multiple roulette games being played simultaneously?
  5. What would need to change in order to make this one game in a series of table games offered by an online casino (note, think about what part of the code can be reused in other games versus what is specific to this game)?

Code 4 Roulette Simulator

Comments?