本文へ移動

Meikyuu迷宮

シード付きの迷路と矢印パズルを作り、番号付きの問題を進め、平面や立体表面で遊べます。

「迷宮」は迷路のように入り組んだ場所を表す言葉です。 名前について(英語)

目次

リファレンス · 遊べる盤

MeikyuuMountOptions型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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

インポート

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

定義

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;
};

メンバー

名前型説明
board (省略可)MeikyuuBoardLook | "paper" | "wood" | "green" | "blue" | "red" | "black" | undefined

A board by name, or its colours.

trail (省略可)"green" | "blue" | "red" | "violet" | "orange" | (string & {}) | undefined

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

wall (省略可)number | undefined

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

line (省略可)number | undefined

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

kind (省略可)"maze" | "arrows" | "mixed" | undefined

Which list the level is from. Default maze.

level (省略可)number | undefined

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

recipe (省略可)string | MazeRecipe | ArrowRecipe | MixedRecipe | undefined

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

tap (省略可)boolean | undefined

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

hints (省略可)boolean | undefined

Offer the Hint button. Default true.

banner (省略可)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 (省略可)boolean | undefined

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

zoom (省略可)boolean | undefined

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

ratio (省略可)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 (省略可)"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 (省略可)number | undefined

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

reserve (省略可)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 (省略可)"both" | "width" | "height" | undefined

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

edgePan (省略可)boolean | undefined

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

pan (省略可)boolean | undefined

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

turnButton (省略可)boolean | undefined

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

sound (省略可)boolean | undefined

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

stones (省略可)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 (省略可)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 (省略可)((detail: MeikyuuEventDetail) => void) | undefined
onSolve (省略可)((detail: MeikyuuEventDetail) => void) | undefined
onKey (省略可)((detail: MeikyuuEventDetail) => void) | undefined
onUnlock (省略可)((detail: MeikyuuEventDetail) => void) | undefined
onBump (省略可)((detail: MeikyuuEventDetail) => void) | undefined
onLose (省略可)((detail: MeikyuuEventDetail) => void) | undefined
onStones (省略可)((detail: MeikyuuEventDetail) => void) | undefined

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

例

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'
}

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/meikyuu 3.2.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。