リファレンス
四角に切れの規則
import { … } from "@johnmorrisdotca/kazu/shikaku";
最小化と gzip 圧縮をしたサイズは 5.3 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Shikaku shares Kazu's number puzzle package, with its own rectangle model.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
checkShikaku | 関数 | A finished partition is checked against the rules, never against a stored answer. |
decodeShikaku | 関数 | Read a native saved Shikaku game, or null for invalid board data or progress. |
encodeShikaku | 関数 | Versioned public puzzle and placement data, with no hidden answer. |
generateShikaku | 関数 | Seeded rectangles packed into the board, one number each, with an independently counted, unique answer. |
generateShikakuChallenge | 関数 | Generate a seeded Shikaku puzzle with a verified unique answer; unsupported inputs or exhausted attempts throw. |
hintShikaku | 関数 | A rectangle is offered only when the remaining partition has one proved answer. |
isShikakuBoard | 関数 | Whether dimensions and area clues describe a possible partition. |
newShikaku | 関数 | Begin with a copy of just the public clues; a generated answer is never kept in play. |
placeShikaku | 関数 | Place a rectangle, replacing any it touches. |
rateShikaku | 関数 | Rates a board with one answer by solving it with the first rule, with the first two, with all three, then by supposing. |
removeShikaku | 関数 | Remove the rectangle containing a cell. |
SHIKAKU_CHALLENGE_PACKS | 定数 | Three short, named challenge routes using the regular seeded unique-puzzle generator. |
SHIKAKU_LEVELS | 定数 | How hard a puzzle is made, by what a person must do to solve it; see rateShikaku. |
SHIKAKU_MOST_ATTEMPTS | 定数 | The native Shikaku generation-attempt limit. |
SHIKAKU_MOST_NODES | 定数 | The native Shikaku search-node budget. |
SHIKAKU_MOST_SIDE | 定数 | Bounds keep custom boards and searches finite. |
SHIKAKU_SIZES | 定数 | The sides on offer for a square board; any side from 2 to SHIKAKU_MOST_SIDE can be made. |
ShikakuBoard | 型 | One area clue per rectangle; zero is an unnumbered cell. |
shikakuCandidates | 関数 | All legal rectangles for a numbered cell, in a stable order. |
shikakuCells | 関数 | Cells of a bounded rectangle, or null for invalid coordinates. |
ShikakuChallenge | 型 | The named route, board shape, difficulty and seed of one Shikaku challenge. |
ShikakuChallengePuzzle | 型 | A named Shikaku challenge paired with its generated unique puzzle. |
ShikakuCheck | 型 | The Shikaku completion result and cells that violate its native rules. |
shikakuFinished | 関数 | Whether this Shikaku game satisfies its complete native rules. |
ShikakuGame | 型 | The immutable Shikaku board, current entries or marks, undo history and assistance state. |
ShikakuLevel | 型 | A native difficulty tier for generated Shikaku puzzles. |
ShikakuPackKey | 型 | One of the square, wide or tall native Shikaku challenge routes. |
ShikakuPuzzle | 型 | A seeded Shikaku board with its verified solution and native difficulty tier. |
ShikakuRating | 型 | How hard a board is, measured by solving it. |
ShikakuRectangle | 型 | A rectangle uses zero-based column and row coordinates. |
ShikakuSolve | 型 | A bounded Shikaku solve result: answer count, first solution, node work and whether the search completed. |
solveShikaku | 関数 | Exact cover over squares. |
undoShikaku | 関数 | Return the Shikaku game with its previous marks or entries restored, or unchanged when there is no undo history. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。