Automated gambling to test strategies.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Card Betting

As I'm starting to learn a few schools of thought related to betting and card games, I figured it'd be worth building my own "automated casino" so that I could test different card game strategies and collect some of my own data.

The project layout is as follows:

  • has the base classes for cards and a deck
  • has the standard rules for dealing out hands, standard dealer logic and end game scenarios (via exceptions)
  • contains all of the logic that a player would use to play the game

There are currently two (2) interfaces:


This lets you play a single game via the command line, passing in h to hit or s to stay. The game will end with an exception that indicates the game's final state.

python [-n 1000]

This plays the specified number of games against the dealer, using the player logic in, and prints out some summary statistics at the end.

Try tweaking the player logic to test your own strategies and see if you can win more than you lose!

Partially inspired by jmmk's collection of "Connect 4" games.