Reference
Regions rules
import { … } from "@johnmorrisdotca/kazu/regions";
6.5 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
checkRegions | function | Checks region connectivity and area without consulting a generated answer. |
decodeRegionsGame | function | Read a native saved Regions game, or null for invalid board data or progress. |
drawRegions | function | Render the Regions board and supplied current state as native SVG text. |
encodeRegionsGame | function | Encode the Regions board and current game as native resumable text. |
entryRegions | function | Group connected cells carrying the same entry into candidate regions. |
generateRegions | function | Makes a seeded puzzle and proves its answer is the only one. |
hintRegions | function | Find a native Regions hint, or null when no actionable hint is available. |
isRegionsBoard | function | Whether the value has valid native Regions dimensions, clues and data. |
newRegions | function | Create the initial immutable Regions game from a valid board. |
rateRegions | function | Rates a board with one answer by solving it as a person would: with the rules, then by supposing one number at a time. |
REGIONS_GENERATOR_MOST_CELLS | constant | The maximum number of cells accepted by the Regions generator. |
REGIONS_LEAST_GENERATED_SIDE | constant | The minimum supported Regions board dimension for generation. |
REGIONS_LEVELS | constant | How hard a puzzle is made, by what a person must do to solve it; see rateRegions. |
REGIONS_MOST_ATTEMPTS | constant | The native Regions generation-attempt limit. |
REGIONS_MOST_NODES | constant | The native Regions search-node budget. |
REGIONS_MOST_SIDE | constant | The maximum supported Regions board dimension. |
REGIONS_SIZES | constant | The sides on offer for a square board; any side from 4 to REGIONS_MOST_SIDE can be made. |
RegionsBoard | type | Regions dimensions and printed clues in their native row-major representation. |
RegionsCheck | type | The Regions completion result and cells that violate its native rules. |
RegionsDrawOptions | type | Current Regions marks or entries, selection, errors and native SVG appearance choices. |
regionsFinished | function | Whether this Regions game satisfies its complete native rules. |
RegionsGame | type | The immutable Regions board, current entries or marks, undo history and assistance state. |
RegionsLevel | type | A native difficulty tier for generated Regions puzzles. |
regionsNeighbours | function | Read orthogonally adjacent Regions cells. |
RegionsPuzzle | type | A seeded Regions board with its verified solution and native difficulty tier. |
RegionsRating | type | How hard a board is, measured by solving it. |
RegionsSolve | type | A bounded Regions solve result: answer count, first solution, node work and whether the search completed. |
restartRegions | function | Return the Regions game reset to its initial entries or marks. |
setRegionsCell | function | Apply the requested native Regions entry or mark to a new immutable game; invalid or fixed targets stay unchanged. |
solveRegions | function | Counts completed partitions. |
undoRegions | function | Return the Regions game with its previous marks or entries restored, or unchanged when there is no undo history. |