This game AI was created for a final project at Indiana University. The goal of the project was to create an artificial intelligence which used a well known algorithm in order to solve a game of our choice. My group had chosen a lesser known card game called "Beat the Box". After many trials and a lot of research we came to the conclusion that the Monte Carlo algorithm would be best suited for solving the card game.
Beat the Box is a card game played by randomizing a standard deck of cards and placing the top 9 cards from the deck face up in a 3x3 square. The idea of the game is the player will pick one of the cards in the square and guess one of three options which are higher, lower, or the same as the number on the card on top of the initially chosen stack. After the guess, you will take a card from the top of the deck and place it on the stack which was picked. If a player guesses wrong, then they can’t play on that stack any more making it a dead stack. If they guess correctly, the player will continue with the game without any penalties for that move. You must do this over and over until there are no cards left in the deck, which results in a win, or all stacks are dead, resulting in a loss.
The original plan for implementing an algorithm for this card game was to use a variation of Expectiminimax which classically has one player who is trying to 'minimize' the score while the other is trying to 'maximize' it. Since this is a single player, or group, game we discovered that the Monte Carlo algorithm was better suited. On each move the algorithm selects a card which has the highest probability of being correct, creates a sample space of which cards are left in the deck, calculates a number based on how many cards are higher, lower or the same as the initially selected cards. Using the number calculated, it makes a choice of higher, lower or the same.