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 - 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.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Some history as motivation3m 46s
-
Different types of games2m 17s
-
(Locked)
Tree-based decision-making2m 28s
-
(Locked)
Time complexity of brute force approaches2m 56s
-
(Locked)
Time complexity of chess2m 31s
-
The cat trap game3m 36s
-
(Locked)
The Python setting for the cat trap3m 51s
-
(Locked)
Code example: A random cat5m
-
-
-
-
-
-