The “Self-referential Goodness” Award

Presented by mit-mit to:

Python Prison (discretegames)

A puzzle game where you have to bribe cops and write Python programs to break out of jail!


Despite explaining to the cops "everyone wears a balaclava to the bank" you keep inexplicably finding yourself locked in jails. Luckily there's plenty of materials around to bribe the guards with. If not perhaps you can make more? You may end up having to execute some of the characters the jail holds...

Can you make your way out to the redemptive grass?

To Play

Download and extract the zip and navigate to the folder and run these commands:

pip install -r requirements.txt

Python Prison was Built using Python 3.9.2 and pygame 2.0.1 and tested on the latest Python 3.9.4.

It was tested on Windows 10 and Linux Mint but not Mac OS because I don't have a Mac computer to test it on.

I have received reports it may crash around level 5 on Mac :(


  • WASD/Arrows - move
  • Shift - sprint
  • Space - pull
  • 1 - set the top left of the blue execution region
  • 2 - set the bottom right of the blue execution region
  • 3 - set the top left of the red output region
  • 4 - set the bottom right of the red output region
  • R - run the code contained in the blue execution region
  • Esc - reset level
  • M - toggle mute
  • I - toggle info
  • F9 - main menu
  • F10 skip level (cheating!)
  • F12 skip to sandbox (cheating!)

Video Playthrough

A full playthrough can be watched here - - but be sure to try the game yourself first!

gif demo

Resources Used

I wrote all the code and made all the assets for the game except for the following: