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

Hitori rules

import { … } from "@johnmorrisdotca/kazu/hitori";

4.5 kB minified and gzipped, with everything it imports (measured with esbuild)

Exports

NameKindWhat it is
checkHitorifunctionChecks unshaded row and column duplicates, adjacent shades, and white connectivity.
decodeHitorifunctionRead a native saved Hitori game, or null for invalid board data or progress.
encodeHitorifunctionVersioned public clue and mark data; the generated answer is not saved.
generateHitorifunctionMakes a seeded puzzle and proves its answer is the only one.
hintHitorifunctionGives one next shade in the unique minimal solution, if uniqueness was proved.
HITORI_LEAST_SIDEconstantThe minimum supported Hitori board dimension.
HITORI_LEVELSconstantHow hard a puzzle is made, by what a person must do to solve it; see rateHitori.
HITORI_MAX_NODESconstantThe native Hitori search-node budget.
HITORI_MOST_ATTEMPTSconstantThe native Hitori generation-attempt limit.
HITORI_MOST_SIDEconstantThe maximum supported Hitori board dimension.
HITORI_SIZESconstantThe sides on offer; any side from 4 to HITORI_MOST_SIDE is a board isHitoriBoard takes.
HitoriBoardtypeHitori dimensions and printed clues in their native row-major representation.
HitoriGametypeThe immutable Hitori board, current entries or marks, undo history and assistance state.
HitoriLeveltypeA native difficulty tier for generated Hitori puzzles.
hitoriNeighborsfunctionRead orthogonally adjacent cells on a square Hitori board.
HitoriPuzzletypeA seeded Hitori board with its verified solution and native difficulty tier.
HitoriRatingtypeHow hard a board is, measured by solving it.
HitoriSolvetypeA bounded Hitori solve result: answer count, first solution, node work and whether the search completed.
isHitoriBoardfunctionWhether the value has valid native Hitori dimensions, clues and data.
newHitorifunctionCreate the initial immutable Hitori game from a valid board.
rateHitorifunctionRates a board with one answer by solving it: with the plain rules, with the whites-stay-together rule, then by supposing.
restartHitorifunctionReturn the Hitori game reset to its initial entries or marks.
shadeHitorifunctionApply the requested native Hitori entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
solveHitorifunctionCounts distinct minimal shade patterns: an answer shades only squares that settle a duplicate, so extra shades are never a second answer.
undoHitorifunctionReturn the Hitori 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.