I am interested in using your service. I am building a Blackjack game in python in which I need to implement a tree search AI for the player to select the optimal choice. I have already built a simple blackjack game in Python, but need to implement the AI. Essentially,implement the AI for the player, and I essentially "watch" the game.Just make sure to pause the script between each turn and wait for the user (me) to press enter before advancing to the next card, so that I can step through the game one action at a time.
For blackjack, after the initial cards are dealt, the player can exercise a one-time option to adjust the "bust" mark between 21 and 25. For tree search, minimax is a reasonable choice since this is two-player. However, unless the hands and the deck are all face-up, there is also an element of randomness that minimax can not model. To address this, you can combine both minimax and expectimax to get "expectiminimax". This method has a game tree with three types of nodes: min nodes, max nodes, and chance nodes. Chance nodes occur after a player's turn when multiple random outcomes are possible (drawing different cards), and their utility is the expected value of their children's utilities. For state representation, the state needs to be represented as arrays of numbers in order to feed it into a neural networks. For blackjack, you can use two arrays that represent the two players' face-up cards. For array shape, you can use 4xL, where length L is a suitably large number (say 15) and you always expect games to end before this many cards are dealt. The length-4 dimension is per-suit. An value between 1 and 13 at position [s,n] indicates that the nth card in the player's hand has suite s with the corresponding value. Your text-based game implementation from the last milestone must now be updated to include a tree-based AI. If it is one-player, it should show me the AI's action in each turn and wait for me to press "enter" before performing the action. If it is multi-player, than I will play for one player, and the other player(s) should be controlled by AI. There should be two AIs that I can choose from at the start of the game: the tree-based one, or a "baseline" AI which chooses actions uniformly at random. For the tree-based AI, after every turn, your program should display the number of tree nodes that the AI processed before selecting its action. Your AI should not take more than 1 minute per turn. If it takes longer, use a depth limit or other pruning strategy.