Reference
Shikaku rules
import { … } from "@johnmorrisdotca/kazu/shikaku";
5.3 kB minified and gzipped, with everything it imports (measured with esbuild)
Shikaku shares Kazu's number puzzle package, with its own rectangle model.
Exports
| Name | Kind | What it is |
|---|---|---|
checkShikaku | function | A finished partition is checked against the rules, never against a stored answer. |
decodeShikaku | function | Read a native saved Shikaku game, or null for invalid board data or progress. |
encodeShikaku | function | Versioned public puzzle and placement data, with no hidden answer. |
generateShikaku | function | Seeded rectangles packed into the board, one number each, with an independently counted, unique answer. |
generateShikakuChallenge | function | Generate a seeded Shikaku puzzle with a verified unique answer; unsupported inputs or exhausted attempts throw. |
hintShikaku | function | A rectangle is offered only when the remaining partition has one proved answer. |
isShikakuBoard | function | Whether dimensions and area clues describe a possible partition. |
newShikaku | function | Begin with a copy of just the public clues; a generated answer is never kept in play. |
placeShikaku | function | Place a rectangle, replacing any it touches. |
rateShikaku | function | Rates a board with one answer by solving it with the first rule, with the first two, with all three, then by supposing. |
removeShikaku | function | Remove the rectangle containing a cell. |
SHIKAKU_CHALLENGE_PACKS | constant | Three short, named challenge routes using the regular seeded unique-puzzle generator. |
SHIKAKU_LEVELS | constant | How hard a puzzle is made, by what a person must do to solve it; see rateShikaku. |
SHIKAKU_MOST_ATTEMPTS | constant | The native Shikaku generation-attempt limit. |
SHIKAKU_MOST_NODES | constant | The native Shikaku search-node budget. |
SHIKAKU_MOST_SIDE | constant | Bounds keep custom boards and searches finite. |
SHIKAKU_SIZES | constant | The sides on offer for a square board; any side from 2 to SHIKAKU_MOST_SIDE can be made. |
ShikakuBoard | type | One area clue per rectangle; zero is an unnumbered cell. |
shikakuCandidates | function | All legal rectangles for a numbered cell, in a stable order. |
shikakuCells | function | Cells of a bounded rectangle, or null for invalid coordinates. |
ShikakuChallenge | type | The named route, board shape, difficulty and seed of one Shikaku challenge. |
ShikakuChallengePuzzle | type | A named Shikaku challenge paired with its generated unique puzzle. |
ShikakuCheck | type | The Shikaku completion result and cells that violate its native rules. |
shikakuFinished | function | Whether this Shikaku game satisfies its complete native rules. |
ShikakuGame | type | The immutable Shikaku board, current entries or marks, undo history and assistance state. |
ShikakuLevel | type | A native difficulty tier for generated Shikaku puzzles. |
ShikakuPackKey | type | One of the square, wide or tall native Shikaku challenge routes. |
ShikakuPuzzle | type | A seeded Shikaku board with its verified solution and native difficulty tier. |
ShikakuRating | type | How hard a board is, measured by solving it. |
ShikakuRectangle | type | A rectangle uses zero-based column and row coordinates. |
ShikakuSolve | type | A bounded Shikaku solve result: answer count, first solution, node work and whether the search completed. |
solveShikaku | function | Exact cover over squares. |
undoShikaku | function | Return the Shikaku game with its previous marks or entries restored, or unchanged when there is no undo history. |