Tutorials

This section provides various tutorials for using the PyRat library. These tutorials cover different use cases and help you understand how to implement your own games using the PyRat API.

Start here

If you are new to PyRat, follow these tutorials in order. Together, they take you from the players provided in your workspace to a game configured the way you want.

The Random Programs

The four example players of your workspace, from the simplest to the smartest, each one fixing a weakness of the previous one.

The Random Programs
Customizing Your Game

Change the maze size, the amount of mud, the number of cheese pieces, the skins of your players, and more.

Customizing Your Game
Game Modes

How time is shared between players, and which mode to use for debugging, for a match, or for running many games.

Choosing a Game Mode
Stopping a Game

How to interrupt a game cleanly from your own code.

Stopping a PyRat Game

Going further

When you are familiar with the basics, these tutorials cover more advanced needs.

Building a Maze

Describe your own maze, or generate one with the random maze algorithms provided by PyRat.

Building a Maze
Postprocessing

Run code once the game is over, for instance to analyze what your player did.

The postprocessing(...) Method

Tip

Looking for a specific class or function instead? The PyRat API documents every element of the library, and the Workspace API documents the programs that come with your workspace.