This repository contains Python scripts for generating and solving mazes using a graphical user interface (GUI) built with tkinter.
blackpill.py: Python script for generating and solving mazes, with one entrance and exit point.whitepill.py: Python script for generating and solving mazes, with additional starting and ending points.
- Make sure you have Python installed on your system.
- Clone this repository to your local machine.
- Run either
blackpill.pyorwhitepill.pyusing Python. - Click the "Generate Maze" button to generate a maze and its solution (if exists).
- The generated maze will be displayed on the tkinter canvas.
The maze generation algorithm used is a randomized version of the depth-first search algorithm. It creates a maze by randomly removing walls between cells while ensuring connectivity between the entrance and exit points.
The maze solving algorithm used is a depth-first search (DFS) algorithm. It explores the maze to find a path from the entrance to the exit, if one exists.
- Python 3.x
- tkinter (Python's standard GUI toolkit)