Create and solve mazes in Python.
from maze import *
m = Maze()
m.create(25, 25, Maze.Create.BACKTRACKING)
m.save_maze()
m.solve((0, 0), (24, 24), Maze.Solve.DEPTH)
m.save_solution()
The code above creates the following pictures:
- Recursive backtracking algorithm
- Hunt and kill algorithm
- Eller's algorithm
- Sidewinder algorithm
- Prim's algorithm
- Kruskal's algorithm
- Depth-first search
- Breadth-first search
The recursive backtracking algorithm and depth-first search are also implemented in C. They are around 100x faster than their Python counterparts.
Simply go into the setup.py
directory and run pip install .
to install the package.
- NumPy
- Pillow
- pyprocessing if you want to run the visual examples