Skip to content

A random maze generator and solver implemented using various maze generation algorithms

Notifications You must be signed in to change notification settings

zhixuanevelynwu/maze_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Random Maze Generator & Longest Path Solver

Table of Contents

About

This is a maze generator implemented using various PCG algorithms. The functions for solving the longest paths in each maze and marking the deadends are also implemented.

Getting Started

Prerequisites

Have Python3 environment and Pygame Library installed to run the map visualization locally.

Installing

Clone the repo to your local folder

git clone https://github.com/zhixuanevelynwu/maze_generator.git

Usage

On your terminal, navigate to the project folder and run

python3 show_maze.py

You will open up a black pygame window. Now, to generate random mazes with different algorithms, use the control below:

- "A": Run Aldous-Broder random walk algorithm.
- "B": Run Binary Tree algorithm.
- "S": Run Sidewinder algorithm.
- "W": Run Wilson's algorithm.
- "R": Run Recursive Backtracker algorithm.
- "H": Run Hybrid Aldous-Broder-Wilson algorithm.
- "N": Erase the previous maze. You will need to type "N" each time before running a new algorithm visualization.
- "L": Run a Dijkstra’s algorithm to solve for the longest path in the maze.
- "D": Colorcode all the deadends in the map.
- "C": Colorize the distance from each cell on the map to the center.

Below are some example outputs: initial window initial window initial window initial window

Releases

No releases published

Packages

No packages published

Languages