From the course: AI Algorithms for Gaming
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
The Python setting for the cat trap - Python Tutorial
From the course: AI Algorithms for Gaming
The Python setting for the cat trap
- [Man] The Python setting for the Cat Trap consists of three source files. First, we have CatTrap.py. This file contains the implementation of the graphical user interface, and the logic for the game. It also contains some controls for you to choose which algorithms to use. Throughout the course, I will only show you some parts of this file. Next, we have hexutil.py. Now, this is a library that contains functions that allow us to print a hex grid. We will not go through this file in the course. However, you may want to skim through it just to see what's going on. Now, the third file is CatGame.py. This is where you'll find my code. And, as you may expect, this is where we'll spend most of our time. Now, please be advised that I will only show you some select parts of the code: The relevant parts to the algorithm at hand. So, please have this file handy to read it slowly. So, let me show you how the Cat Trap game…
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 1s
-
-
-
-
-
-