Extra Content

This page is reserved for additional content that wasn't placed in the book. This includes extra programs and info that is related to the book, but was left out in order to keep the size low.

More content will be placed here as it is organized. Check the book blog for updates.

Gorillas.py: A remake of Gorillas.bas

gorillas.py - An entire generation of people remember the Gorillas.BAS game that came with Qbasic, where gorillas on top of buildings threw exploding bananas at each other. This is a Python remake of that game using the Pygame game engine, and is fairly heavily commented so you can explore the source. To play the game in your browser, there is also a Flash version of Gorillas.BAS.

Lights Out puzzle game source code

lightsout.py - This is a puzzle game called Lights Out. Ideally you should have read up to the Sonar chapter in the book in order to be able to understand the code. You can, of course, just download the script and play the game even if you haven't read that far.

Choose Your Own Adventure: Dragon Realm source code

dragon2.py - This is a "Choose Your Own Adventures"-style puzzle game. Unlike the book though, the adventure randomly changes itself each time you play. This affords some replay value in the game and makes it more interactive than the Dragon Realm game in the book, which is just a simple coin toss. The program is long, but not very complicated. I advise reading up to the Dragon Realm chapter to understand the code. Or you can simply download the source code and play the game. Here is a short explanation of the game and the code.

Four in a Row

fourinarow_text.py - This is a clone of Connect Four. The AI is fairly impossible to beat.