Skip to content

apexSolarKiss/mazeASK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

179 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mazeASK

mazeASK

Maze generation algorithms


Live sketch

https://editor.p5js.org/asymptoticSystemKey/full/FJk1OWjNb

Best viewed on desktop in Chrome.


What this is

An interactive p5.js lab for exploring maze generation algorithms through their behavior and output.

Switch between algorithms and watch how each one builds structure in real time.

Same grid. Same constraints. Different rules.

Why this repo exists

mazeASK is an expression of intent on three layers >>


Architecture

mazeASK.js is structured as a single p5.js sketch with three phases >> initialization, incremental generation, and rendering. The step...() functions contain the algorithm-specific generation logic.

For the conceptual generalization path from rectangular mazes to topology-owned structure, see docs/didactic/generalization-narrative.md.


Algorithms

  • Recursive Backtracker
  • Binary Tree
  • Prim
  • Sidewinder
  • Eller
  • Kruskal
  • Wilson
  • Aldous–Broder

See docs/didactic/algorithm-notes.md for a breakdown of each algorithm and what it produces.


Key idea

All of these are doing the same thing >>

building a spanning tree.

What changes is how the next connection is chosen.

That choice introduces bias.
That bias shapes the structure.
That structure is what you see.


Controls

Algorithms

  • 1 Recursive Backtracker
  • 2 Binary Tree
  • 3 Prim
  • 4 Sidewinder
  • 5 Eller
  • 6 Kruskal
  • 7 Wilson
  • 8 Aldous–Broder

Interaction

  • click save PNG output
  • e toggle start + finish overlay
  • s toggle solution path overlay
  • space regenerate
  • r recolor
  • h toggle rectangular / hex topology
  • c toggle rectangular / radial topology
  • t toggle rectangular / triangle topology
  • - / + adjust speed

Density

  • [ decrease grid
  • ] increase grid

Output

  • o toggle output mode
  • p cycle square / 4:3 / widescreen

Topology mode

Rectangular is the default baseline.

Hex is opt-in through the H toggle and currently works for >>

  • Recursive Backtracker
  • Binary Tree
  • Prim
  • Aldous–Broder
  • Wilson
  • Kruskal

Radial is opt-in through the C toggle and currently works for >>

  • Recursive Backtracker
  • Binary Tree
  • Prim
  • Aldous–Broder
  • Wilson
  • Kruskal

Radial does not yet claim support for >>

  • Sidewinder
  • Eller

Triangle is opt-in through the T toggle and currently works for >>

  • Recursive Backtracker
  • Binary Tree
  • Prim
  • Aldous–Broder
  • Wilson
  • Kruskal

Sidewinder and Eller remain rectangular-only for now.


License

Copyright 2026 Andrew S Klug // ASK

Licensed under the Apache License 2.0 // see LICENSE

Packages

 
 
 

Contributors