Skip to the content

Meikyuu迷宮

Generate seeded mazes and arrow puzzles, follow numbered levels, and play on flat grids or three-dimensional surfaces.

Meikyuu is the Japanese word 迷宮 for labyrinth. About the name

Contents

How-to

Choose geometry, algorithms and modes

Keep the full recipe when sharing a reproducible puzzle.

Encode the full recipe

import {buildMaze,recipeCode,parseRecipe,MEIKYUU_ALGORITHMS,MEIKYUU_MODES} from "@johnmorrisdotca/meikyuu";
const recipe = {shape:"square",w:5,h:5,algorithm:"prim",mode:"enter-leave",seed:42} as const;
const code = recipeCode(recipe);
console.log(code,parseRecipe(code),MEIKYUU_ALGORITHMS,MEIKYUU_MODES);
console.log(buildMaze(recipe).entrance!==null);
square:5x5:prim:enter-leave:42 {
  shape: 'square',
  w: 5,
  h: 5,
  algorithm: 'prim',
  mode: 'enter-leave',
  seed: 42
} [
  'backtracker',
  'hunt',
  'growing',
  'prim',
  'kruskal',
  'wilson',
  'eller'
] [ 'enter-leave', 'to-goal', 'centre-out', 'keys' ]
true

Seven algorithms carve passage graphs. Shapes include square, hexagon, triangle, circular rings and cut-out masks. Check supported dimensions and cell limits; a circular grid's rings are not the same as a rectangular width/height. Eller is not a surface algorithm. Native parsers return null for malformed recipe text; builders reject invalid recipes rather than quietly changing them.

The play mode matters

Enter/leave provides boundary doors. Goal, centre-out and key modes choose different endpoints or collected keys; a goal-mode maze may have no boundary entrance at all. Keep shape, dimensions, algorithm, mode, seed and key count together. Appearance and orientation affect drawing, not puzzle identity. See MORE-MAZES.md and buildMaze.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/meikyuu 3.2.0.