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 · Surface maze rules and geometry

SolidMazetype

A maze over a solid: what a flat maze has that is not flat. It is a MazeCore, so the game, the stones, the steps and the measure play it as they play any maze.

Import it

import type { SolidMaze } from "@johnmorrisdotca/meikyuu/3d";

Definition

type SolidMaze = MazeCore & {
    readonly recipe: SolidRecipe;
    readonly grid: SolidGrid;
    readonly links: Links;
    readonly start: number;
    readonly goal: number;
    readonly keys: readonly number[];
};

Members

NameTypeDescription
linksLinks
startnumber
goalnumber
keysreadonly number[]

Always empty: a maze over a solid has no keys.

grid{ readonly cells: number; readonly neighbours: readonly (readonly number[])[]; } & SolidGrid
recipeSolidRecipe

Examples

import type { SolidMaze, SolidRecipe } from "@johnmorrisdotca/meikyuu/3d";
import { buildSolidMaze } from "@johnmorrisdotca/meikyuu/3d";

const solidRecipe: SolidRecipe = {kind:"cube",n:2,algorithm:"backtracker",seed:42};
const solid = buildSolidMaze(solidRecipe);
const value: SolidMaze = solid;
console.log(value);
{
  recipe: { kind: 'cube', n: 2, algorithm: 'backtracker', seed: 42 },
  grid: {
    kind: 'cube',
    n: 2,
    shape: 'cube',
    w: 2,
    h: 2,
    cells: 24,
    neighbours: [
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array]
    ],
    corners: [
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array]
    ],
    vertices: [
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array]
    ],
    centres: [
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array]
    ],
    normals: [
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array]
    ],
    radii: [
      0.5, 0.5, 0.5, 0.5, 0.5,
      0.5, 0.5, 0.5, 0.5, 0.5,
      0.5, 0.5, 0.5, 0.5, 0.5,
      0.5, 0.5, 0.5, 0.5, 0.5,
      0.5, 0.5, 0.5, 0.5
    ],
    faceOf: [
      0, 0, 0, 0, 1, 1, 1, 1,
      2, 2, 2, 2, 3, 3, 3, 3,
      4, 4, 4, 4, 5, 5, 5, 5
    ],
    edges: [
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object]
    ],
    sideEdge: [
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array],
      [Array], [Array], [Array]
    ],
    hull: [
      [Array], [Array],
      [Array], [Array],
      [Array], [Array],
      [Array], [Array]
    ],
    reach: 1.7320508075688772,
    round: false,
    convex: true,
    upright: false
  },
  links: [
    [ 2, 21 ],     [ 23 ],
    [ 3, 0, 17 ],  [ 11, 2 ],
    [ 12, 5 ],     [ 4, 7 ],
    [ 16 ],        [ 5, 9 ],
    [ 9, 10 ],     [ 7, 8 ],
    [ 8, 11 ],     [ 10, 3 ],
    [ 13, 4 ],     [ 15, 12 ],
    [ 15 ],        [ 14, 13 ],
    [ 17, 18, 6 ], [ 2, 16 ],
    [ 16, 19 ],    [ 18 ],
    [ 21, 22 ],    [ 0, 20 ],
    [ 20, 23 ],    [ 22, 1 ]
  ],
  start: 6,
  goal: 1,
  keys: []
}

What it prints (run when this page was built)

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