This is a pretty basic Roulette simulator with the intend to practice my OOP and SOLID principles. This repo has now been enhanced to practice using Docker and Dockerfiles.
$ composer install
$ php simulate run:simulation
$ docker-compose down
$ docker-compose build
$ docker-compose up -d
At the moment, Players must be added manually via the SimulationController.php file.
To define a Player, you must pass three arguments when instantiating a Player
- A "Strategy". Either "Martingale" or "None"
- A initial amount. The "Stack". eg
1000
- A playing "Style". Options are "aggressive" or "cautious". Bet amounts will be adjusted accordingly
The only way a Player can win is if he/she has (currently) at least 5 times the amount of their initial stake. If this happens, the Player will walk away from the table.
If a Player is playing the Martingale strategy then they can only bet on even-money outside bets (eg Red or Black). If they lose the round, the Player will bet exactly double the previous bet just lost. If they lose again, they will bet double again.. and so on and so on.. until either they win a round and start again or they lose all their money.
A section bet is a sub-set of the Straight Up bet type. It was pretty fun to implement.