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

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

8.7 kB minified and gzipped, with everything it imports (measured with esbuild)

Meikyuu's drawing: a maze or an arrow board as SVG text, with its boards, its line colours, the style that gives the drawing its look, and the words it says in English and Japanese. A separate entry (@johnmorrisdotca/meikyuu/draw), so a server that only builds mazes never loads any of it.

Exports

NameKindWhat it is
arrowColourfunctionThe colour of arrow number id.
arrowMarkupfunctionThe arrow's picture: its stem, its head, and a padlock if it is locked.
boardLookOffunctionThe look a board name or board object means.
doorPlacefunctionWhere a door is: the middle of its gap in the wall, and the way out through it as a unit vector.
drawArrowsfunctionRender the native arrow board, locked/present arrows and optional hint as SVG text.
DrawArrowsOptionstypeAN ARROW BOARD AS SVG TEXT: a faint dot on every cell of the picture, and each arrow on it as a line through its cells with a head at the end it points from.
drawMazefunctionThe maze as SVG text.
DrawMazeOptionstypeNative maze appearance, current trail, collected keys, stones, hints, label and SVG presentation choices.
fixedfunctionA number as short text: two decimals at most, so a drawing is small.
framedfunctionThe rectangle to look at to see the whole of a shape with a margin of pad cells.
linePathfunctionA line through the middles of the cells, in order.
lookAttributesfunctionThe attributes (as text) that make an element a Meikyuu drawing: its class, its look, and its custom properties.
lookStylefunctionThe inline custom properties a look needs: none for plain paper with the default line, which the style gives.
marksOffunctionThe marks on a maze: the start, the goal or exit, the doors and the keys, as SVG.
MazeLooktypeWhat a maze looks like: every option that does not depend on where the line is.
MEIKYUU_ARROW_COLOURSconstantThe colours of each arrow on an arrow board, in turn.
MEIKYUU_BOARD_NAMESconstantThe supported named native maze board appearances.
MEIKYUU_BOARDSconstantThe paper, wall, frame and default trail colours of every named maze board.
MEIKYUU_STRINGSconstantNative English and Japanese labels, announcements and interpolation templates.
MEIKYUU_STYLEconstantThe scoped native SVG styles for mazes and arrow boards.
MEIKYUU_TRAIL_NAMESconstantThe supported named native trail colours.
MEIKYUU_TRAILSconstantThe light and dark colours of every named trail.
MeikyuuBoardLooktypeA board's colours: the paper, the walls, the frame, whether it is a dark board, and the line that shows on it when none is chosen.
MeikyuuBoardNametypeA supported named maze board appearance.
MeikyuuLanguagetypeTHE WORDS MEIKYUU SAYS, in English and Japanese: what a screen reader hears of a drawing, what the buttons and the lines under a playable board say, and the names of the shapes and the ways to play.
meikyuuLanguageOffunctionThe language a lang attribute asks for: Japanese for any ja, English for everything else.
meikyuuSayfunctionA line in a language, with its {name} values filled in, and its One form when n is 1.
MeikyuuTrailNametypeA supported named trail palette.
standingWallsfunctionEvery wall of the maze that is standing: between cells that are not joined, and round the outside, except the doors.
stonesOffunctionThe 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.
wallPathfunctionThe path data for a wall: a line, or an arc round the middle of a circle maze.

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