Blackjack, on its surface, is a simple game. The goal: get as close to 21 as possible without going over.
Simple enough, right? In reality, there is a lot more to consider. The number of decks, payouts, doubling rules, shuffling methods, and many other factors contribute to the house edge, the minimum advantage the dealer has over the player. These advantages are calculated assuming play by basic strategy, a guide for moves based solely on probability. Unfortunately, even in the best case scenario and strict basic strategy, the house holds a slight advantage. This means no matter how skilled or lucky you think you are, the house will win eventually. However, the minor house advantage can be reversed using the difficult technique known as counting cards (which although casinos frown upon, is legal). The best counters can supplement the probabilities that determine basic strategy based on the contents of the discard pile to give the player a slight (0.5 - 1 %) advantage.
This application is a simulation of both strategies: basic and counting cards. Here, you can see how they work in action, as well as how they (and other game variables) impact the house edge. With proper play and a little luck, maybe you can hear those magic words: WINNER WINNER CHICKEN DINNER!
These instructions will allow you to see where I am at. These will be updated as I build this project, and will include information about running the application as a user or downloading for development.
The code is currently tested on Linux and Mac OS X. On these operating systems, there should be no prereqs to build and run the source code. However, the fully packaged application has been packaged in QtCreator for Mac as a Mac application, so it must be run on Mac OS. In order do dev on the GUI, QtCreator is required
- Clone the repo. In the main directory, there is a file simply titled "Blackjack" (or Blackjack.app).
- Double click this file and enjoy!
Start by cloning the repository to your local machine.
-
Download, Build, and Run Source Code
-
Use the following commands to build and run:
-
make
- generates executablebin/app
usingmain.cpp
andsrc/Blackjack.cpp
, and places object files inbuild/
. Use./bin/app
to run. -
make test
- generates executablebin/test/
usingtest.cpp
and the object files inbuild/
. If they are not created, it will first runmake
. Use./bin/test
to run the test suite. -
make clean
- cleans the directory by deleting thebuild/
directory and bothbin/app
andbin/test
executables.
-
-
-
Run Catch Test Suite
- See above about command
make test
- See above about command
-
Build and Run GUI in Editor
-
Open Qt Creator
-
Select "Open Project"
-
Select the
chicken_dinner.pro
file insidechicken_dinner/chicken_dinner_ui/src
-
Click the play button to build and run
-
- Catch2 - A modern, C++-native, header-only, test framework
- TravisCI - A hosted, distributed continuous integration service
- Qt - A cross-platform software development for embedded & desktop
Apache 2.0 License Summary: You can do what you like with the software, as long as you include the required notices. This permissive license contains a patent license from the contributors of the code.