Skip to content

Maze generator written in Python using pygame library

Notifications You must be signed in to change notification settings

rabiken/maze_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maze Generator in Python

The program generates a random maze with the number of rows and columns given by user input. Depth First Search(DFS) is used to determin the content of the maze. The generating process is visualized by using Pygame.

Table of Contents

Features

When you run the program, It asks you to choose the number of rows and columns of the maze. Try with 30 rows and 40 columns for example.

Command

The algorithm used is DFS. To visuallize the process of the algorithm, visited tiles, closed tiles (popped from DFS stack), the current tile, and walls are colored in Green, Pink, Red, and Black.

The generating process running: running

After the maze is completed, All the tiles will be colored pink.

Final Output : done

Installation

Follow these steps to install the projects:

  1. Clone the repository:
git clone https://github.com/rabiken/maze_generator.git
cd maze_generator
  1. Create and activate a virtual environment:
  • On macOS and Linux:
python3 -m venv venv
source env/bin/activate
  • On Windows:
py -m venv venv
.\env\Scripts\activate
  1. Install the required dependencies:
pip install -r requirements.txt

Usage

  1. Run the program by:
  • On macOS and Linux:
python3 main.py
  • On Windows:
py main.py

Contributing

If you encounter any bugs or issues with the project, please let me know! Your feedback is invaluable for improving the project.

License

MIT

About

Maze generator written in Python using pygame library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages