课程: AI Algorithms for Game Design with Python

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Tree-based decision-making

Tree-based decision-making

- [Instructor] To play a turn-based game like tic-tac-toe or chess, we are going to use 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 ellipsis mean that I'm not showing further states horizontally or vertically. That's because this tree will get really, really big. So for each of…

内容