StoneRules型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
STONES: a marble laid on a cell of the maze that the line may not enter. Where the maze is big, a player who has found that a passage leads nowhere wants to shut it, so that the line is not drawn down it again and the eye is not led down it either. A stone is a helper of the player's own and never part of the maze: it is not in the recipe, not in the answer and not in any check, and the maze is solved by exactly the line it was before.
It is not a pen. John, who asked for it: "I didn't want people to start painting the map and just placing anywhere... it has to be a carefully placed item that you must lay adjacent to your existing path." So a stone may be laid only
- on a cell the line is not on, and that is not the start or the goal (so the way is never shut at either end),
- on a cell that is joined by open passages to a cell of the line within
reachsteps (1 or 2: next to the line, or one cell beyond that), not counting a way through another stone, so a stone is laid at the root of a passage the line has just passed, never across a wall and never out in the middle of the maze, - while the game has stones left to lay (
limit, or no limit at all), and not once the maze is solved.
A stone is taken up by asking for the cell again, which gives it back. Stones are part of the game's state: Undo puts back what a lay or a
take changed, Restart takes them all up, and encodeRun and decodeRun keep a run with its stones as one short text.
These are pure functions like the rest of the game: each takes a game and returns a new one, or the same one when nothing changed.
インポート
import type { StoneRules } from "@johnmorrisdotca/meikyuu";
定義
type StoneRules = {
readonly limit: number | null;
readonly reach: 1 | 2;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
limit | number | null | How many stones may be down at once, or null for as many as the player likes. |
reach | 2 | 1 | How far from the line a stone may be laid, in cells along the passages: 1 or 2. |
例
import type { StoneRules } from "@johnmorrisdotca/meikyuu";
const value: StoneRules = {limit:5,reach:1};
console.log(value);{ limit: 5, reach: 1 }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。