Skip to the content

Kazu数

Generate checked Sudoku and logic puzzles, read native rules and hints, and draw or embed playable boards.

Kazu is the Japanese word 数 for number. About the name

Contents

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

NameKindWhat it is
checkShikakufunctionA finished partition is checked against the rules, never against a stored answer.
decodeShikakufunctionRead a native saved Shikaku game, or null for invalid board data or progress.
encodeShikakufunctionVersioned public puzzle and placement data, with no hidden answer.
generateShikakufunctionSeeded rectangles packed into the board, one number each, with an independently counted, unique answer.
generateShikakuChallengefunctionGenerate a seeded Shikaku puzzle with a verified unique answer; unsupported inputs or exhausted attempts throw.
hintShikakufunctionA rectangle is offered only when the remaining partition has one proved answer.
isShikakuBoardfunctionWhether dimensions and area clues describe a possible partition.
newShikakufunctionBegin with a copy of just the public clues; a generated answer is never kept in play.
placeShikakufunctionPlace a rectangle, replacing any it touches.
rateShikakufunctionRates a board with one answer by solving it with the first rule, with the first two, with all three, then by supposing.
removeShikakufunctionRemove the rectangle containing a cell.
SHIKAKU_CHALLENGE_PACKSconstantThree short, named challenge routes using the regular seeded unique-puzzle generator.
SHIKAKU_LEVELSconstantHow hard a puzzle is made, by what a person must do to solve it; see rateShikaku.
SHIKAKU_MOST_ATTEMPTSconstantThe native Shikaku generation-attempt limit.
SHIKAKU_MOST_NODESconstantThe native Shikaku search-node budget.
SHIKAKU_MOST_SIDEconstantBounds keep custom boards and searches finite.
SHIKAKU_SIZESconstantThe sides on offer for a square board; any side from 2 to SHIKAKU_MOST_SIDE can be made.
ShikakuBoardtypeOne area clue per rectangle; zero is an unnumbered cell.
shikakuCandidatesfunctionAll legal rectangles for a numbered cell, in a stable order.
shikakuCellsfunctionCells of a bounded rectangle, or null for invalid coordinates.
ShikakuChallengetypeThe named route, board shape, difficulty and seed of one Shikaku challenge.
ShikakuChallengePuzzletypeA named Shikaku challenge paired with its generated unique puzzle.
ShikakuChecktypeThe Shikaku completion result and cells that violate its native rules.
shikakuFinishedfunctionWhether this Shikaku game satisfies its complete native rules.
ShikakuGametypeThe immutable Shikaku board, current entries or marks, undo history and assistance state.
ShikakuLeveltypeA native difficulty tier for generated Shikaku puzzles.
ShikakuPackKeytypeOne of the square, wide or tall native Shikaku challenge routes.
ShikakuPuzzletypeA seeded Shikaku board with its verified solution and native difficulty tier.
ShikakuRatingtypeHow hard a board is, measured by solving it.
ShikakuRectangletypeA rectangle uses zero-based column and row coordinates.
ShikakuSolvetypeA bounded Shikaku solve result: answer count, first solution, node work and whether the search completed.
solveShikakufunctionExact cover over squares.
undoShikakufunctionReturn the Shikaku game with its previous marks or entries restored, or unchanged when there is no undo history.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kazu 2.1.0.