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

layoutCellsfunction

How many cells laying out a recipe's grid takes, counted before anything is built: the grid's own cells for squares, hexagons, triangles and circles, and the whole raster for a shape cut out of one (a cut-out shape keeps fewer, but is built from all of them). A hexagon of radius w is cut from a hex grid 2w + 1 across, and a pyramid of w rows from a triangle grid twice as wide as it is tall.

Import it

import { layoutCells } from "@johnmorrisdotca/meikyuu";

Definition

function layoutCells(shape: MeikyuuShape, w: number, h: number): number

Parameters

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

The supported native flat-grid geometry or cut-out shape.

wnumber

The native grid width in cells.

hnumber

The native grid height in cells.

Returns

number

How many cells laying out a recipe's grid takes, counted before anything is built: the grid's own cells for squares, hexagons, triangles and circles, and the whole raster for a shape cut out of one (a cut-out shape keeps fewer, but is built from all of them). A hexagon of radius w is cut from a hex grid 2w + 1 across, and a pyramid of w rows from a triangle grid twice as wide as it is tall.

Examples

import { layoutCells } from "@johnmorrisdotca/meikyuu";

console.log(layoutCells("square",5,5));
25

What it prints (run when this page was built)

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