A simple Python console application that allows a user to experiment with various blackjack setups and calculate the expected win/loss ratio of one or more players given a particular setup.
The default config lives at configs/default.json and supports the following fields:
- numDecks: The number of decks the dealer is using
- shuffleRatio: The ratio of the original deck size, after which the shuffler will perform a reshuffle of the deck of cards
- players: The set of players to include in the game (the stats of each player will be displayed at the end)
- numGames: The number of rounds to play
- doubleDownEnabled: Whether the double down player action is enabled
- splitEnabled: Whether the split player action is enabled
- ddasEnabled: Whether the double down after split player action is enabled
Sample output after simulation ends:
Player: Alice, winnings: $-99650.0, total wins: 43123, total losses: 47749, total draws: 9128, win ratio: 0.43
Player: John, winnings: $-545500.0, total wins: 41047, total losses: 48566, total draws: 10387, win ratio: 0.41
Player: Timothy, winnings: $-78300.0, total wins: 43119, total losses: 47484, total draws: 9397, win ratio: 0.43
The chart strategy used is according to this table:

src/
cli.py
domain/
probability/
reporting/
util/
simulation/
strategies/
tests/
configs/
assets/
python main.py
python main.py --config configs/default.json
python main.py --test
python -m pytest tests -vManual test mode is terminal-driven and does not require the keyboard package or root privileges. Press Enter to play the next round and q to quit.