Reference
Nurikabe rules
import { … } from "@johnmorrisdotca/kazu/nurikabe";
2.2 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
checkNurikabe | function | Checks island areas and separation, the connected sea, and the ban on 2×2 sea blocks. |
decodeNurikabe | function | Read a native saved Nurikabe game, or null for invalid board data or progress. |
encodeNurikabe | function | Encode the Nurikabe board and current game as native resumable text. |
generateNurikabe | function | Seeded symmetries of original 5×5 layouts are returned only after the solver proves uniqueness. |
hintNurikabe | function | Find a native Nurikabe hint, or null when no actionable hint is available. |
isNurikabeBoard | function | Whether the value has valid native Nurikabe dimensions, clues and data. |
markNurikabeSea | function | Apply the requested native Nurikabe entry or mark to a new immutable game; invalid or fixed targets stay unchanged. |
newNurikabe | function | Create the initial immutable Nurikabe game from a valid board. |
NURIKABE_MAX_NODES | constant | The native Nurikabe search-node budget. |
NURIKABE_SIZES | constant | The supported Nurikabe board sizes. |
NurikabeBoard | type | Nurikabe dimensions and printed clues in their native row-major representation. |
NurikabeGame | type | The immutable Nurikabe board, current entries or marks, undo history and assistance state. |
nurikabeNeighbors | function | Read orthogonally adjacent cells on a square Nurikabe board. |
NurikabePuzzle | type | A seeded Nurikabe board with its verified solution. |
NurikabeSolve | type | A bounded Nurikabe solve result: answer count, first solution, node work and whether the search completed. |
restartNurikabe | function | Return the Nurikabe game reset to its initial entries or marks. |
solveNurikabe | function | Counts valid island placements and checks the remaining cells as the sea under a finite budget. |
undoNurikabe | function | Return the Nurikabe game with its previous marks or entries restored, or unchanged when there is no undo history. |