This is a collection of simple board games implemented in Python with Pygame Zero. These games are selected as possible exercises for entry-level programming education. More details about the criteria for inclusion and other considerations can be found in this paper.
In a nutshell:
-
If you are teaching programming, use game rules as a basis for your exercises, and check out the provided code to assess exercise difficulty. The "Core LOC" value provides a good quick estimation.
-
If you are studying programming, read game rules and try to implement the game alone or with a friend. Don't read the existing code unless you have finished your solution or absolutely need a hint.
The code provided is supposed to be simple and straightforward, resembling a "good enough" exercise solution: there are neither strong fool-proof mechanisms, nor polished GUIs. The main purpose of these examples is to demonstrate the complexity of a particular game from the software developer's perspective.
Each game comes with a text interface, a graphical interface, and a small number of pytest-powered unit tests.
Once your task is done, you can try making it more challenging:
-
Implement a 3+ player version of the game (where applicable).
-
Make it possible to save and restore game sessions.
-
Implement a remote (network) play capability.
-
Implement a game AI system.
Install Poetry, then run
poetry install
to install dependencies. Check the pages of individual games for more information.
All games in the table satisfy certain criteria. They are at least mildly interesting (have BoardGameGeek rating of 5.0 and above), they are quick to play (at most 15 min), have simple rules, and, in principle, designed for a two-player hotseat mode. Thus, there are no hidden cards and other information assumed to be private. None of the games require preparing extensive assests (cards, tiles, maps) or presume natural language proficiency, which makes them suitable for international groups.
Very occasional deviations from the "two-player" criterion include solo games, 3-player games, and games where one of the players can be easily replaced with an algorithm. In the latter case hidden information is allowed, since there is only one human player involved.
The "Core LOC" column in the games table shows the size of code shared between the CLI and the GUI versions of the game. In most cases, making GUI requires considerably more skills and effort, even with an easy-to-use framework. The "GUI value" evaluates the playability of the game without GUI. If it is low, a text-based interface is not painful to use.
Name | BGG Rating | Core LOC | GUI value | Players | Category | Topics |
---|---|---|---|---|---|---|
5.3 | 25 | Low | 2 | Dice | Basics | |
5.6 | 25 | Low | 1-2 | Deduction | Basics, Arrays | |
5.6 | 25 | Low | 1+ | Dice | Basics, Arrays | |
5.9 | 50 | Low | 2 | Abstract | Arrays | |
6.1 | 50 | High | 2 | Abstract | 2D Arrays | |
7.1 | 50 | Low | 3-7 | Cards | Arrays, Algorithms | |
6.1 | 50 | High | 2 | Abstract | 2D Arrays, Algorithms+ | |
6.7 | 50 | Low | 2-5 | Dice | Arrays, Algorithms | |
6.4 | 50 | Low | 2-5 | Cards | Basics, Arrays | |
5.6 | 50 | Low | 1+ | Dice | Arrays, Algorithms | |
5.1 | 50 | Low | 2+ | Dice | Arrays, Algorithms | |
6.2 | 50 | High | 2 | Abstract | 2D Arrays, Algorithms | |
5.1 | 100 | Low | 2+ | Dice | Arrays, Algorithms | |
6.7 | 100 | High | 2-3 | Abstract | Graphs, Algorithms+ | |
6.4 | 100 | Low | 1-2 | Deduction | 2D Arrays, Algorithms+ | |
6.4 | 100 | High | 1+ | Dice | 2D Arrays, Algorithms | |
6.5 | 100 | High | 2 | Abstract | 2D Arrays, Algorithms | |
6.3 | 150 | Low | 2 | Economic | Basics | |
7.4 | 150 | High | 1 | Cards | 2D Arrays, Algorithms+ | |
6.8 | 200 | High | 2 | Abstract | 2D Arrays, Algorithms+ | |
7.4 | 200 | High | 2 | Abstract | 2D Arrays, Graphs |