Colonel Blotto Game

I recreated the Colonel Blotto game entirely using R, using Shiny to host it as an online applet. The Colonel Blotto game is a classic problem in game theory where two players divide a fixed number of troops across castles with different strategic importance. Each castle is won by whoever commits more troops, and the overall winner is determined by the total value of castles won.
I modeled the Colonel’s behavior using Thompson sampling, a Bayesian approach to adaptive decision making that allows decisions to improve over time through experience. This method allows it to evaluate how well each option would have performed against the player’s move after every round and adjust how likely it is to choose each one in the future. This process naturally balances trying strategies that have worked well before with occasionally exploring new ones, which keeps the Colonel adaptive and unpredictable. I modified datasets from FiveThirtyEight to help the Colonel figure out strategies.
The game can be played at https://maranheads.shinyapps.io/colonelblotto/