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 runThe 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 developWhilst 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
srcdirectory contains the source code for the maze solver, and is structured as follows:main.pyis the entry point. This file draws the window and adds in some window controls.class_window.pycontains theWindow,PointandLineclassses, which generates a window and can draw lines.class_cell.pycontains theCellclass, and associated code for drawing the cells, and drawing a "move" between two cells.class_maze.pycontains theMazeclass, and the logic for drawing and solving the maze.class_window_controlscontains theWindowControls,CustomButtonandCustomLabelclasses. This is the logic for drawing the buttons at the bottom of the window, along with the maze status.theme.py, contains aThemeclass 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
testsdirectory 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
