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

Nurikabe rules

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

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

Exports

NameKindWhat it is
checkNurikabefunctionChecks island areas and separation, the connected sea, and the ban on 2×2 sea blocks.
decodeNurikabefunctionRead a native saved Nurikabe game, or null for invalid board data or progress.
encodeNurikabefunctionEncode the Nurikabe board and current game as native resumable text.
generateNurikabefunctionSeeded symmetries of original 5×5 layouts are returned only after the solver proves uniqueness.
hintNurikabefunctionFind a native Nurikabe hint, or null when no actionable hint is available.
isNurikabeBoardfunctionWhether the value has valid native Nurikabe dimensions, clues and data.
markNurikabeSeafunctionApply the requested native Nurikabe entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
newNurikabefunctionCreate the initial immutable Nurikabe game from a valid board.
NURIKABE_MAX_NODESconstantThe native Nurikabe search-node budget.
NURIKABE_SIZESconstantThe supported Nurikabe board sizes.
NurikabeBoardtypeNurikabe dimensions and printed clues in their native row-major representation.
NurikabeGametypeThe immutable Nurikabe board, current entries or marks, undo history and assistance state.
nurikabeNeighborsfunctionRead orthogonally adjacent cells on a square Nurikabe board.
NurikabePuzzletypeA seeded Nurikabe board with its verified solution.
NurikabeSolvetypeA bounded Nurikabe solve result: answer count, first solution, node work and whether the search completed.
restartNurikabefunctionReturn the Nurikabe game reset to its initial entries or marks.
solveNurikabefunctionCounts valid island placements and checks the remaining cells as the sea under a finite budget.
undoNurikabefunctionReturn the Nurikabe 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.