本文へ移動

Tobiishi飛び石

9種類の盤で石を飛び越え、シード付きの解ける問題を作り、ページにペグ・ソリティアを追加できます。

「飛び石」は、間を空けて並べた石のことです。 名前について(英語)

目次

リファレンス

盤・規則・チャレンジ

import { … } from "@johnmorrisdotca/tobiishi";

最小化と gzip 圧縮をしたサイズは 3.8 kB(読み込むものをすべて含み、esbuild で計測)

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

エクスポート

名前種類概要
Board型Immutable hole lattice and all legal jump triples for a board.
boardOf関数A familiar lattice or a shaped outline.
Cell型A hole's stable coordinate within a board shape, independent of its drawing.
Challenge型A starting position paired with its complete legal witness and seed.
ChallengeDifficulty型Requested witness length category; this is not a measured human rating.
challengeOf関数Generates a seeded challenge on a built-in shape, optionally fixing its final hole.
ChallengePack型Curated goal choices for one supported board shape.
classicEnglish関数Returns the classic centre-empty English game with its complete solution.
classicTriangle関数Returns the full triangle with the apex empty and any final hole accepted.
Game型Immutable peg position, target, move history, and assistance marker.
gameCode関数Versioned save: replay, rather than accepting a claimed final position.
gameFromCode関数Validates and replays a versioned save string, returning null if invalid.
generate関数Grow backward from one peg.
generateTobiishiChallenge関数Creates one fixed-goal puzzle with a complete, replayable legal answer.
GoalChallenge型Generated puzzle augmented with its pack, goal, and requested length category.
GoalHole型Named goal hole and its localized menu labels.
isGameSolved関数Checks whether one peg remains at the required target, if any.
isGameStuck関数Checks whether no legal continuation remains before the goal is reached.
Jump型A legal solitaire jump from an occupied hole over a peg to an empty hole.
jumpAt関数Invalid jumps leave a game unchanged; a valid jump removes exactly one peg.
legalJumps関数Lists legal jumps from the current position.
makeBoard関数Make a board from holes and a lattice; absent holes cannot be crossed.
markHelped関数Mark an assisted run without changing pieces or history.
newGame関数Creates a validated immutable position with the given target hole, if any.
pegCount関数Counts pegs remaining on the board.
rectangleBoard関数Creates a square-lattice rectangle, including supported wide and tall boards.
restart関数Restores the original peg arrangement and clears moves and assistance.
seededRandom関数Creates a deterministic pseudo-random stream from a text seed.
Shape型Built-in board outlines supported by the player and challenge packs.
SHAPES定数Built-in shape names in player-menu order.
Solution型Bounded search result; limit distinguishes unfinished search from proof.
solve関数A bounded depth-first proof search.
SQUARE_STEPS定数Orthogonal direction steps used by square-lattice boards.
TOBIISHI_CHALLENGE_PACKS定数Named challenge pack metadata; each goal is a distinct hole with a legal witness.
TRIANGLE_STEPS定数Six jump directions used by the triangular lattice.
undo関数Returns the previous position, or the same game when history is empty.
VERSION定数Current package API version.

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

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