Help: Text-Based Roulette Game
First of all, I would like to thank anyone that takes the time to read and respond to my thread. I am still currently in my first semester of programming and taking a small c++ class in college. To get a better understanding of what a single line of code could possibly represent I'm starting my first project with an interest I have. The program I want to create is not necessarily a game, but could be converted as such. What I aim to accomplish is to make a game related program that tests probabilty and other statistics.
The biggest difficulty for me is I have written simple programs that consist of asking for a series of numbers and it would calculate the sum, difference, average, etc. The algorithms required for the program I want is a little more advanced then anything we have done in class thus far. To me the difficulty makes the project more fun, and I don't think that it is out of my abilities completely. I would like some guidance from anyone interested in giving me advice and/or algorithm help on designing a basic program.
This next portion says in so many words what I want to get out of my program. In advance I am sorry for how long this is, but I wanted to try and be clear on what I want my program to do. If there are holes in the way I am thinking of setting this up let me know.
I want it to just show text saying "Welcome! How much would you like to deposit into our casino? Only use numerical values! <= 1" Else, the message repeats until you give an accepted answer. Then, output $ "X Dollars". For example, for 1000 would output "You have deposited $1000 good luck!"
Next, it asks "What wheel would you like to place your bets on?" "American" and "European" are the only accepted answers. Else, repeat statement until accepted answer is typed. Exception for the wrong answers in the future is "Floor". This will bring the player back to this question at any time. "What wheel would you like to place your bets on?"
Next, it asks "Would you like to bet using a loop? Yes or No?" Typing Y, N, Yes, and No, would be the only accepted answers. Else, it would repeat the statement until you gave the right choice.
Next, if "Yes" is choosen it asks "How many spins would you like the roulette wheel to make?" Only whole numbers are to be accepted in this portion of the program. Else, repeat question. If "No" is choosen less questions should be asked. "How much would you like to bet?", "Where would you like to place your bets?", and "Would you like the croupier to spin?" options should follow.
Next, it asks "How much money would you like to bet for the requested amount of spins?" Only whole numbers should be accepted here as well to make it easier for calculations and testing <= 1. The feedback to the answer should be "Would you like your $ "X Dollars" disbursed?" For example, 1000 should respond with "Would you like your $ 1000 disbursed?"
"No" implies that only one bet is going to be placed and "Yes" implies that $"X Dollars" will be divided among the number of bets you place. Same same thing should apply for eaither a looped bet or single bet. The reason is to show the results of a consistent bet. The acceptable yes or no answers apply here too.
Next, I would like the croupier (program) to ask "How many bets would you like to place?" Whole numbers should only be accepted here as well <= 1.
Next, "What is your starting bet?" Whole numbers only allowed.
Next, "What is your maximum bet?" Whole numbers only allowed.
Next, "Would you like to increase your bets as you win or lose?"
"Yes" asks would you like your bets to increase as you win or lose?" "Win" and "Lose" are the only options.
Next, "How would you like to increase your betting? Only whole numbers and 'N' or 'n' is allowed to increase the betting by the number of spins." I would like this part of the program to even process equations involving powers. For example, I would like to be able to put "(1^n + 10)". If the starting bet is $10 and you lost three times in a row the third bet would be (1^3 + 10) = (3 + 10) = 13. I know this is a dumb bet since you would not even break even. This is simply an example. My teacher never went into powers, but he did go into using '%'.
Next, it should ask Would you like to enable temporary betting? "Yes" and "No" applies with "Details" as an added option.
If "Details" is selected it should say "The temporary betting feature prevents a gambler from betting too high and losing all of his money on a high streak! When your current bet exceeds the maximum bet, temporary betting automatically works for that spin."
"Yes" asks "What would you like to set your temporary bet as?" Whole numbers only allowed.
Temporary betting is only enabled when the next spin would exceed the maximum bet. Also, it is disabled once a spin results in a win, or the loop is terminated. When a win occurs, the starting bet is applied before the next spin.
Display Table Now!
Before you place your bets it will now show a table of what bets you can place, the payout, and what numbers would win. For example, a "Five-Number Bet" and "Odd Bet" would display "The payoff on your Five-Number Bet is 6 to 1!" and "0, 00, 1, 2 or 3 wins!" and "The payoffon your Odd bet is 1 to 1!" and "All odd numbers win!" The Five-Number Bet is only an option on the "American Wheel" option and I have to have certain bets and values to spin on not available depending on what wheel is used.
Next, based on the number of bets you place it will ask "Where would you like to place your bets?" If you follow the betting options you proceed to the next question.
Next, it needs to calculate the amount of money you wished to bet per spin divided by the number of bets placed.
Next, it needs to summarize the options choosen for the bets.
Next, it needs to ask if the bets placed are correct. Yes and no options are the same once again.
Next, it asks "Would you like the croupier to spin at this time?" Yes and no options are the same once again.
At this time results should be being generated. Program should stop at the end of the loop, after one spin if no loop is selected, or if there isn't enough money to cover the current bet for the loop. Once the betting stops it shows how much you earned.
Next, the program says "Are you ready to continue with the results?" Only "Yes" works unless once again if you type "Floor" to take you back to the casino floor. Else, repeat previous statement until a correct answer is typed.
Next, With a "Yes" list how many times in a row (streak) both your bet had won and lost in a row with five and more as the value of the streak. Also, if a streak of ten occurs it should not indicate that a streak of five occured twice and ten occured once. Then, it should indicate how many times the bet had to be reset to the starting bet due to a high streak, if requested to increase bets based on wins or losses until you can not cover the bet with the range selected. Also, if enabled how many spins was temporary betting used.
If this occurs the first thing that should happen is if a temporary bet is
selected, that amount should be used for future spins until the win or loss
option selected results in terminating the temporary bet. This is only used so
long streaks do not cause you to lose all of your money. If you can't cover
any bet it should automatically bet the original amount and continue to increase as it did before. However, if the current funds can not even cover the temporary
bet or starting bet, then the loop is terminated. As stated above!
After the report the program should ask. "Would you like to place anymore bets?" Yes and no answers apply.
"No" brings back to casino floor with new bankroll.
"Yes" asks "Would you like to repeat your bets? with or without the money you earned?" Only "With" and "Without" applies.
"With" uses new bankroll to place same bet.
"Without" gives away earnings and tests the betting again.
I think this was really detailed...maybe too detailed, but I hope it was a good outline of what I want to accomplish. Also, I hope what I typed can help anyone give me some guidance on writing my program. I figure I'm doing great if I can eventually make this program and understand it. Even if I get help from you fellow programmers along the way. Thanks in advance to those that assist me or read my post at least.