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

Reference · Mazes, arrows and mixed boards

MazeRecipetype

Everything that makes a maze.

Import it

import type { MazeRecipe } from "@johnmorrisdotca/meikyuu";

Definition

type MazeRecipe = {
    readonly shape: MeikyuuShape;
    readonly w: number;
    readonly h: number;
    readonly algorithm: MeikyuuAlgorithm;
    readonly mode: MeikyuuMode;
    readonly seed: number;
    readonly keys?: number;
};

Members

NameTypeDescription
shape"square" | "circle" | "hex" | "triangle" | "heart" | "leaf" | "star" | "ring" | "diamond" | "cross" | "moon" | "hexagon" | "pyramid"
wnumber

Columns, rings, a radius or the size of the square a shape is cut from: see gridOf.

hnumber

Rows, for the shapes that have them; the same as w for the others.

algorithm"backtracker" | "hunt" | "growing" | "prim" | "kruskal" | "wilson" | "eller"
mode"enter-leave" | "to-goal" | "centre-out" | "keys"
seednumber
keys (optional)number | undefined

How many keys, for the keys way to play.

Examples

import type { MazeRecipe } from "@johnmorrisdotca/meikyuu";

const recipe: MazeRecipe = {shape:"square",w:5,h:5,algorithm:"backtracker",mode:"to-goal",seed:42};
const value: MazeRecipe = recipe;
console.log(value);
{
  shape: 'square',
  w: 5,
  h: 5,
  algorithm: 'backtracker',
  mode: 'to-goal',
  seed: 42
}

What it prints (run when this page was built)

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