Skip to content

Maze-generation algorithms in JS rendered step by step

License

Notifications You must be signed in to change notification settings

johnellmore/maze-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maze Generation Algorithms

This web app implements and demonstrates several maze generation algorithms.

Try it out | Background blog post

Intro

The "Maze generation algorithm" Wikipedia article is fascinating reading to get some background here. Effectively, most mazes are just graphs, with each "cell" beind a node in the graph and each opening (missing wall) being an edge in that graph. Generating a good maze (with no loops) is therefore done by finding a minimum spanning tree of that graph.

In this demo, we model the maze as a graph, and then implement renderers which can draw that graph to an HTML canvas. Maze generation algorithms operate on the graph directly, with no concept of the visual shape of the maze.

To view the demo, just clone the repo, host it somewhere, and open it in your browser. You need a relatively recent browser with ES module support.

About

Maze-generation algorithms in JS rendered step by step

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published