Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 1.63 KB

readme.md

File metadata and controls

54 lines (38 loc) · 1.63 KB

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