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 · Playable boards

MeikyuuMountOptionstype

Native puzzle/level/recipe, display, controls, sound, stones and event callbacks for a flat player.

Import it

import type { MeikyuuMountOptions } from "@johnmorrisdotca/meikyuu/play";

Definition

type MeikyuuMountOptions = MazeLook & {
    kind?: MeikyuuKind;
    level?: number;
    recipe?: string | MazeRecipe | ArrowRecipe | MixedRecipe;
    tap?: boolean;
    hints?: boolean;
    banner?: boolean;
    controls?: boolean;
    zoom?: boolean;
    ratio?: "square" | "maze" | number;
    orientation?: MeikyuuOrientation;
    gutter?: number;
    reserve?: number;
    fit?: FitMode;
    edgePan?: boolean;
    pan?: boolean;
    turnButton?: boolean;
    sound?: boolean;
    stones?: StoneOption;
    language?: MeikyuuLanguage;
    onMove?: (detail: MeikyuuEventDetail) => void;
    onSolve?: (detail: MeikyuuEventDetail) => void;
    onKey?: (detail: MeikyuuEventDetail) => void;
    onUnlock?: (detail: MeikyuuEventDetail) => void;
    onBump?: (detail: MeikyuuEventDetail) => void;
    onLose?: (detail: MeikyuuEventDetail) => void;
    onStones?: (detail: MeikyuuEventDetail) => void;
};

Members

NameTypeDescription
board (optional)MeikyuuBoardLook | "paper" | "wood" | "green" | "blue" | "red" | "black" | undefined

A board by name, or its colours.

trail (optional)"green" | "blue" | "red" | "violet" | "orange" | (string & {}) | undefined

The line's colour: one of the named ones, or any CSS colour.

wall (optional)number | undefined

The thickness of a wall, in cells. Default 0.12.

line (optional)number | undefined

The thickness of the line, in cells. Default 0.34.

kind (optional)"maze" | "arrows" | "mixed" | undefined

Which list the level is from. Default maze.

level (optional)number | undefined

A level of the package's own lists, from 1.

recipe (optional)string | MazeRecipe | ArrowRecipe | MixedRecipe | undefined

A recipe of your own, as its code or as an object, instead of a level.

tap (optional)boolean | undefined

A tap runs the line along the corridor to the next fork. Default false.

hints (optional)boolean | undefined

Offer the Hint button. Default true.

banner (optional)boolean | undefined

Show the message over the board when the puzzle is solved ("Solved in 3 strokes."); a tap on it, its close button or Escape puts it away. False for none (the line of words under the board still says so). Default true.

controls (optional)boolean | undefined

The buttons and the lines of words under the board. Default true.

zoom (optional)boolean | undefined

The zoom pad. Default true. (The wheel and the pinch always work.)

ratio (optional)number | "maze" | "square" | undefined

The shape of the box, width over height as the maze was made: square (default, one steady square whatever is drawn), maze (the maze's own, between 1:2 and 2:1), or a number such as 2 / 3 for the tall levels (level.ratio). A maze that is turned has the box turned with it.

orientation (optional)"portrait" | "landscape" | "auto" | undefined

Which way up the maze is shown: portrait (stand a wide maze up), landscape (lay a tall one down), or auto, the default: lay a tall maze down when the room (the host's width and the window's height) fits it bigger that way. A square box and a square maze are never turned.

gutter (optional)number | undefined

The page left beside the box on each side, in pixels, at least. Default 24 (MEIKYUU_GUTTER).

reserve (optional)number | undefined

What the window holds besides the box, in pixels. Default 200 (MEIKYUU_RESERVE). The box is never taller than the window less this (and never under 60% of it).

fit (optional)"both" | "width" | "height" | undefined

What Fit shows: the whole maze (both, default), its width or its height.

edgePan (optional)boolean | undefined

A line drawn to the edge of a zoomed box moves the view along. Default true.

pan (optional)boolean | undefined

Start with every one-finger drag moving the view, not drawing (the Move button toggles it). Default false.

turnButton (optional)boolean | undefined

Show a Turn button in the pad, for a maze that is not square. Default false.

sound (optional)boolean | undefined

Make a sound for each thing that happens. Default false.

stones (optional)StoneOption | undefined

Stones for mazes: true for the defaults, or { limit, reach } (how many may lie at once, null for no limit and left out for stoneLimitFor the maze's cells; and how far from the line one may be laid, 1 or 2 cells, 2 by default). Default off. Adds the Stone button to the board's own buttons.

language (optional)MeikyuuLanguage | undefined

The language the words are in. Left out, the host's own lang, or the page's, and it follows the page's.

onMove (optional)((detail: MeikyuuEventDetail) => void) | undefined
onSolve (optional)((detail: MeikyuuEventDetail) => void) | undefined
onKey (optional)((detail: MeikyuuEventDetail) => void) | undefined
onUnlock (optional)((detail: MeikyuuEventDetail) => void) | undefined
onBump (optional)((detail: MeikyuuEventDetail) => void) | undefined
onLose (optional)((detail: MeikyuuEventDetail) => void) | undefined
onStones (optional)((detail: MeikyuuEventDetail) => void) | undefined

A stone was laid or taken up, or the stones were cleared, restarted or undone.

Examples

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

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

What it prints (run when this page was built)

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