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

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…

Contents