how to simulate an american roulette
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Table of roulette there are 36 numbers which vary their color there are 18 red and 18 black, and there are two green (0 to 00). If a player bets No amount of color and this falls wins the stake, but if you bet the number and this falls earn double the bet, but if it falls on 0 Green and players lose and win the house, but if it falls 00 is not won or lost only re-spin the wheel.
Pretend there are two players each begins with N amount of money, the house begins with triple the amount of the initial amounts of the players, the simulation will be made to (1-25) shots roulette player may be withdrawn at anytime wait to finish the simulation. Each player can bet: • By Color. • A specific number. • Both. They simulate roulette N times which turned must have: • That each player wagered by certain twist. • That player wins at every turn. • Final amount of each player and the house. • That probability of each player winning according to games played. • Show the graph of the plays (by rotation).
6 commentaires
Geoff Hayes
le 24 Nov 2014
David - so the above seems to run for one spin of the wheel only. So you probably want to put the above code in a loop that will run N times (where N can be an input parameter to your function, if you change this from a script).
You also need to add some checks in the code to ensure that the players do not bet more money than they have. Suppose the player has only 50 dollars, but attempts to bet 600. You will need to guard against this.
Réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!