Blackjack simulation

broken image
broken image
broken image

Depending on how many rounds you choose it can get slow as it’ll simulate according to your choices every time you hit the RUN SIMULATION RUN. The app is composed of a sidebar with a space to choose the archetypes, the number of decks to use, and how many rounds you want to see simulated. If you are familiar with the R language you can also run the app locally, you just need to run the library(shiny) and runGitHub('blackjack-simulation', 'devmedeiros', ref = 'main'). There you can find the rules considered for the simulation and the complete code. In the app, you are limited by the number of players, but if you wish to run the code with more players you can check the GitHub repository. I also made a shiny app to display how the simulation works.

broken image

With this set of functions, you can run a single game with p players, d decks, any combination of players archetypes. I got inspired to simulate a blackjack game, so I decided to make a series of functions to emulate the dealer’s behavior, a newbie player, a cautious player, and a strategist.

broken image