Question: Write a Ruby program to simulate a roulette wheel and determine if one can double their money by doubling up on their losing bets. On

Write a Ruby program to simulate a roulette wheel and determine if one can double their money

by doubling up on their losing bets.

On a roulette wheel (using the double

zero layout)

there are

38 slots for the ball to fall in.

18 are colored black, 18 are colored red, and 2 are colored green.

If

you bet on red or black, the payoff is 1 to 1, but the odds are slightly less than 50% (which is how

the house makes money).

Below is a pi

cture of a standard double

zero wheel:

Your goal is to write a ruby program that simulates the spining

of a roulette wheel (for which you

will use a random generator), the betting on one color, and the decision of where there is a payoff

or not.

You will also simulate the double of the losing bet, and resetting back to the base bet after

winning. You also

need to keep track of the total amount of money you have (which will call your

bank) to determine if you

can make the next bet or not.

Then you want to see if you can double

your bank of

money by using this strategy.

You also need to have the correct odds

(the correct

number of slots and correct color) as well as the correct pay off.

When you lose, you lose your

bet.

When you win, you keep your bet, plus earn the same as your bet (i.e. double your bet).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!