This is a maze solver, that draws a random maze, then solves that maze.
This project uses Nix flakes. Nix must be installed with the experimental-features nix-command
and flakes
enabled.
To run the maze solver:
nix run
The maze will be generated to fill the size of the window at the time the Generate Maze
button is pressed.
To enter a development shell with all the necessary dependencies available:
nix develop
Whilst developing using nix develop
, there are several commands available:
build
- runs the maze solvertests
- executes unit tests for the projectformat check
- checks code formatting using blackformat fix
- fixes code formatting using blacklint
- lints the code using basedpyright
- The
src
directory contains the source code for the maze solver, and is structured as follows:main.py
is the entry point. This file draws the window and adds in some window controls.class_window.py
contains theWindow
,Point
andLine
classses, which generates a window and can draw lines.class_cell.py
contains theCell
class, and associated code for drawing the cells, and drawing a "move" between two cells.class_maze.py
contains theMaze
class, and the logic for drawing and solving the maze.class_window_controls
contains theWindowControls
,CustomButton
andCustomLabel
classes. This is the logic for drawing the buttons at the bottom of the window, along with the maze status.theme.py
, contains aTheme
class that is used to provide a consistent theme on all elements of the window. At present, the colors used in this theme are from the Rosé Pine palette.
- The
tests
directory contains unit tests for the project. There's not too much to test.
- I learned that type annotation exist in Python, and I like Rust [insert blazingly-fast meme here], so I have used those liberally.
This project was built as part of the Maze Solver Course from Boot.Dev