リファレンス
ひとりにしてくれの規則
import { … } from "@johnmorrisdotca/kazu/hitori";
最小化と gzip 圧縮をしたサイズは 4.5 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
checkHitori | 関数 | Checks unshaded row and column duplicates, adjacent shades, and white connectivity. |
decodeHitori | 関数 | Read a native saved Hitori game, or null for invalid board data or progress. |
encodeHitori | 関数 | Versioned public clue and mark data; the generated answer is not saved. |
generateHitori | 関数 | Makes a seeded puzzle and proves its answer is the only one. |
hintHitori | 関数 | Gives one next shade in the unique minimal solution, if uniqueness was proved. |
HITORI_LEAST_SIDE | 定数 | The minimum supported Hitori board dimension. |
HITORI_LEVELS | 定数 | How hard a puzzle is made, by what a person must do to solve it; see rateHitori. |
HITORI_MAX_NODES | 定数 | The native Hitori search-node budget. |
HITORI_MOST_ATTEMPTS | 定数 | The native Hitori generation-attempt limit. |
HITORI_MOST_SIDE | 定数 | The maximum supported Hitori board dimension. |
HITORI_SIZES | 定数 | The sides on offer; any side from 4 to HITORI_MOST_SIDE is a board isHitoriBoard takes. |
HitoriBoard | 型 | Hitori dimensions and printed clues in their native row-major representation. |
HitoriGame | 型 | The immutable Hitori board, current entries or marks, undo history and assistance state. |
HitoriLevel | 型 | A native difficulty tier for generated Hitori puzzles. |
hitoriNeighbors | 関数 | Read orthogonally adjacent cells on a square Hitori board. |
HitoriPuzzle | 型 | A seeded Hitori board with its verified solution and native difficulty tier. |
HitoriRating | 型 | How hard a board is, measured by solving it. |
HitoriSolve | 型 | A bounded Hitori solve result: answer count, first solution, node work and whether the search completed. |
isHitoriBoard | 関数 | Whether the value has valid native Hitori dimensions, clues and data. |
newHitori | 関数 | Create the initial immutable Hitori game from a valid board. |
rateHitori | 関数 | Rates a board with one answer by solving it: with the plain rules, with the whites-stay-together rule, then by supposing. |
restartHitori | 関数 | Return the Hitori game reset to its initial entries or marks. |
shadeHitori | 関数 | Apply the requested native Hitori entry or mark to a new immutable game; invalid or fixed targets stay unchanged. |
solveHitori | 関数 | Counts distinct minimal shade patterns: an answer shades only squares that settle a duplicate, so extra shades are never a second answer. |
undoHitori | 関数 | Return the Hitori game with its previous marks or entries restored, or unchanged when there is no undo history. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。