Labyrinth game

Age at the end of the project: 15

Labyrinth game

This is one of my very first programming projects, made in high school when I was 15, during the computer science option. What started as a simple maze game in Python grew into a program of almost 2000 lines, with a full graphical interface made with Tkinter.

The program generates random perfect mazes of any size. It starts with every wall closed, then removes random walls between areas that are not connected yet, until every cell can be reached by exactly one path. You can then play with many options: start again when you hit a wall, blind mode, bonuses to collect in the corners before reaching the exit, two players, or draw and save your own mazes. I also added a second game in the same program, a naval battle that you can play against an AI or against a friend.

The code

The whole game is a single Python file that only uses the standard library. Download it and run it with Python 3: python Laby4.py

Download the code

The game

Generating mazes, playing them and the naval battle

Maze generator

Maze generator

A random 70 by 70 perfect maze generated by the program