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 · SVG grids

stonesOffunction

The stones laid on a maze, as SVG: each a marble (mk-stone) with a small gleam (mk-gleam) on the cell, one unit across being a cell.

Import it

import { stonesOf } from "@johnmorrisdotca/meikyuu/draw";

Definition

function stonesOf(maze: Maze, stones: readonly number[]): string

Parameters

NameTypeDescription
mazeMaze

The valid flat/surface maze or required maze-core fields.

stonesreadonly number[]

The currently placed passage-blocking stones.

Returns

string

The stones laid on a maze, as SVG: each a marble (mk-stone) with a small gleam (mk-gleam) on the cell, one unit across being a cell.

Examples

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

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

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