Blackjack, also known to some as twenty-one, is one of the most popular casino games around the world. Blackjack is a card game that pits the player(s) against a dealer. One or more players can play this game at a time, and it is usually played with 1-8 decks of cards.
The goal of this project was to simulate the game of Blackjack in Python, by implementing several gameplay strategies and comparing the performance of each of those to draw inferences between them. The odds of winning at blackjack are 42.22% and we aimed to build an AI which uses a strategy that can better this percentage.
To illustrate our results, we simulated the strategies using the Monte Carlo methodology and determined the win percentage for each of the strategies obtained by running a large number of simulations.
Code execution:
To run the code, simply install the dependencies from requirements.txt and execute the blackjack.py file. During execution, you must enter a strategy as an argument which will be used to run the simulations and generate a win percentage. The possible strategies are: [random, simple, basic, counting, ml]