リファレンス
盤・規則・チャレンジ
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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。