Reference · Mazes, arrows and mixed boards
MEIKYUU_ALGORITHMSconstant
THE SEVEN WAYS TO MAKE A PERFECT MAZE, each over any grid: a perfect maze is a spanning tree of the cells, so there is exactly one way between any two of them. They differ in the texture of what they make, which is written up in docs/MAZES.md:
backtracker: walk till stuck, then back up. Long winding passages, few dead ends.hunt: hunt-and-kill. Much the same, a little less winding.growing: growing tree, taking the newest cell half the time and a random one the rest: in between.prim: randomized Prim, taking a random edge from the frontier. Very many short dead ends.kruskal: joins random edges that join different pieces. Many short dead ends, evenly spread.wilson: loop-erased random walks. Every maze equally likely, so no texture of its own.eller: one row at a time. Squares only: it needs rows.
They return each cell's open neighbours. Nothing here reads a cell's position.
Import it
import { MEIKYUU_ALGORITHMS } from "@johnmorrisdotca/meikyuu";
Definition
const MEIKYUU_ALGORITHMS: readonly ["backtracker", "hunt", "growing", "prim", "kruskal", "wilson", "eller"] = ["backtracker", "hunt", "growing", "prim", "kruskal", "wilson", "eller"] as const
Examples
import { MEIKYUU_ALGORITHMS } from "@johnmorrisdotca/meikyuu";
console.log(MEIKYUU_ALGORITHMS);[
'backtracker',
'hunt',
'growing',
'prim',
'kruskal',
'wilson',
'eller'
]What it prints (run when this page was built)