From the course: AI Algorithms for Gaming

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Tree-based decision-making

Tree-based decision-making - Python Tutorial

From the course: AI Algorithms for Gaming

Tree-based decision-making

- [Instructor] To play a turn-based game like Tic-Tac-Toe or chess, we are going to used a tree-based decision-making approach. This technique consists of predicting the outcome of all possible player moves starting at the current state of the game. In this algorithm, we must choose the move that yields the best result for us. Be aware that running this algorithm produces only the next move, not the whole sequence of moves in the future. So this is how tree-based decision-making looks like. Take Tic-Tac-Toe, for example. Let's say the game is about to start, and it's our turn. We have the X-mark, and the opponent has the circle mark. In this first step, we have nine possible moves. We can place our X-mark in the top-left, top-center, top-right, all the way down to the bottom-right square. Now notice how this is creating a tree structure. The ellipses mean that I'm not showing further states horizontally or vertically.…

Contents