/maze_generator

The turtle draws a maze as two separate trees. First finds the longest possible line, then the shorter lines "grow" from it like branches. It's a pretty nice view.

Primary LanguagePython

Maze Generator

Python code generating and drawing a rectangular maze with given number of rows and columns.

The program uses the turtle module for drawing. It treats all the maze's lines as if they were two separate trees or graphs, and the drawing method follows that idea. First, the "trunks" are found, which are the longest possible line of each tree. Then, the turtle draws the longer trunk, and the rest of the lines grows from consecutively it as its branches, gradually filling the whole maze up.

The generator does not use recursion at all, so there is no size limit (at least when it comes to the program itself).

Since the only third-party libraries used during the development were pytest and pre-commit, the program does not require any external modules to run.

Usage

git clone https://github.com/tomaszbar9/maze_generator
python -m maze generator [--help] [-s | --size <width> <height>]
                         [-c | --cell <size>] [--slow] [--close]
maze_generator.mp4