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

Regions rules

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

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

Exports

NameKindWhat it is
checkRegionsfunctionChecks region connectivity and area without consulting a generated answer.
decodeRegionsGamefunctionRead a native saved Regions game, or null for invalid board data or progress.
drawRegionsfunctionRender the Regions board and supplied current state as native SVG text.
encodeRegionsGamefunctionEncode the Regions board and current game as native resumable text.
entryRegionsfunctionGroup connected cells carrying the same entry into candidate regions.
generateRegionsfunctionMakes a seeded puzzle and proves its answer is the only one.
hintRegionsfunctionFind a native Regions hint, or null when no actionable hint is available.
isRegionsBoardfunctionWhether the value has valid native Regions dimensions, clues and data.
newRegionsfunctionCreate the initial immutable Regions game from a valid board.
rateRegionsfunctionRates 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_CELLSconstantThe maximum number of cells accepted by the Regions generator.
REGIONS_LEAST_GENERATED_SIDEconstantThe minimum supported Regions board dimension for generation.
REGIONS_LEVELSconstantHow hard a puzzle is made, by what a person must do to solve it; see rateRegions.
REGIONS_MOST_ATTEMPTSconstantThe native Regions generation-attempt limit.
REGIONS_MOST_NODESconstantThe native Regions search-node budget.
REGIONS_MOST_SIDEconstantThe maximum supported Regions board dimension.
REGIONS_SIZESconstantThe sides on offer for a square board; any side from 4 to REGIONS_MOST_SIDE can be made.
RegionsBoardtypeRegions dimensions and printed clues in their native row-major representation.
RegionsChecktypeThe Regions completion result and cells that violate its native rules.
RegionsDrawOptionstypeCurrent Regions marks or entries, selection, errors and native SVG appearance choices.
regionsFinishedfunctionWhether this Regions game satisfies its complete native rules.
RegionsGametypeThe immutable Regions board, current entries or marks, undo history and assistance state.
RegionsLeveltypeA native difficulty tier for generated Regions puzzles.
regionsNeighboursfunctionRead orthogonally adjacent Regions cells.
RegionsPuzzletypeA seeded Regions board with its verified solution and native difficulty tier.
RegionsRatingtypeHow hard a board is, measured by solving it.
RegionsSolvetypeA bounded Regions solve result: answer count, first solution, node work and whether the search completed.
restartRegionsfunctionReturn the Regions game reset to its initial entries or marks.
setRegionsCellfunctionApply the requested native Regions entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
solveRegionsfunctionCounts completed partitions.
undoRegionsfunctionReturn the Regions 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.