本文へ移動

Meikyuu迷宮

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

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

目次

リファレンス · SVGの盤

DrawMazeOptions型

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

Native maze appearance, current trail, collected keys, stones, hints, label and SVG presentation choices.

インポート

import type { DrawMazeOptions } from "@johnmorrisdotca/meikyuu/draw";

定義

type DrawMazeOptions = MazeLook & {
    path?: readonly number[];
    collected?: readonly number[];
    stones?: readonly number[];
    solution?: boolean;
    hint?: {
        back?: number;
        cells: readonly number[];
    };
    won?: boolean;
    language?: MeikyuuLanguage;
    label?: string;
    standalone?: boolean;
    pad?: number;
    orientation?: MeikyuuOrientation;
};

メンバー

名前型説明
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.

path (省略可)readonly number[] | undefined

The line drawn so far, as cells from the start.

collected (省略可)readonly number[] | undefined

The keys picked up.

stones (省略可)readonly number[] | undefined

The cells with a stone on them (see stones.ts).

solution (省略可)boolean | undefined

Draw the one way from the start to the goal.

hint (省略可){ back?: number; cells: readonly number[]; } | undefined

Cells to light as a hint, and how many cells of the line to draw back first.

won (省略可)boolean | undefined

Whether the maze is solved, which gives the line its colour of a win.

language (省略可)MeikyuuLanguage | undefined
label (省略可)string | undefined

The drawing's own words for a screen reader.

standalone (省略可)boolean | undefined

Put the style in the drawing, so it is a picture on its own.

pad (省略可)number | undefined

The margin round the shape, in cells. Default 0.6.

orientation (省略可)"portrait" | "landscape" | "auto" | undefined

Which way up the picture is: portrait stands a wide maze up and landscape lays a tall one down (a quarter turn counter-clockwise, which changes nothing in the maze, its cells or any line on it); auto, the default, leaves it as it was made. A square maze is never turned.

例

import type { DrawMazeOptions } from "@johnmorrisdotca/meikyuu/draw";

const value: DrawMazeOptions = {label:"Sample maze",solution:true};
console.log(value);
{ label: 'Sample maze', solution: true }

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

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

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