This project models Blackjack as a state machine and, on top of it, uses Bayes' theorem to calculate the expected value of an action for a given Blackjack state.
state_machine/— theBlackjackEngine::StateMachinelibrary: hands, rules, states, and the transitions between them.bayes/— theBlackjackEngine::Bayeslibrary: an expected-value calculator built on top of the state machine.
The following commands build the libraries and the unit test binaries from the repository root:
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build buildThis produces the two libraries:
$ ls build/state_machine/libblackjack_state_machine.a build/bayes/libblackjack_bayes.a
build/bayes/libblackjack_bayes.a build/state_machine/libblackjack_state_machine.aRun the whole test suite with CTest from the build directory:
ctest --test-dir buildThe individual test binaries are build/state_machine/tests/state_machine_tests
and build/bayes/tests/bayes_tests.