Reference
Cross Sums rules
import { … } from "@johnmorrisdotca/kazu/cross-sums";
10.4 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
canReach | function | Whether the remaining distinct digits can reach the target sum in the given slots. |
checkCrossSums | function | Checks exact run sums and distinct digits independently of a stored answer. |
CROSS_SUMS_GENERATION_ATTEMPTS | constant | The native CrossSums generation-attempt limit. |
CROSS_SUMS_GENERATION_NODES | constant | The native CrossSums search-node budget. |
CROSS_SUMS_LEAST_GENERATED_SIDE | constant | The minimum supported CrossSums board dimension for generation. |
CROSS_SUMS_LEVELS | constant | How hard a puzzle is made, by what a person must do to solve it; see rateCrossSums. |
CROSS_SUMS_MAX_ATTEMPTS | constant | The native CrossSums generation-attempt limit. |
CROSS_SUMS_MAX_NODES | constant | The native CrossSums search-node budget. |
CROSS_SUMS_MAX_SIDE | constant | The maximum supported CrossSums board dimension. |
CROSS_SUMS_MIN_SIDE | constant | The minimum supported CrossSums board dimension. |
CROSS_SUMS_PLAY_STYLE | constant | Scoped native CrossSums board and player CSS. |
CROSS_SUMS_SIZES | constant | The sides on offer, counting the row and column of totals; any side from 5 to CROSS_SUMS_MAX_SIDE can be made. |
CROSS_SUMS_STRINGS | constant | Native English and Japanese labels and announcements for CrossSums. |
CrossSumsBoard | type | CrossSums dimensions and printed clues in their native row-major representation. |
CrossSumsCell | type | A white digit cell or a black clue cell with optional across/down totals. |
CrossSumsCheck | type | The CrossSums completion result and cells that violate its native rules. |
CrossSumsDrawOptions | type | Current CrossSums marks or entries, selection, errors and native SVG appearance choices. |
CrossSumsGame | type | The immutable CrossSums board, current entries or marks, undo history and assistance state. |
CrossSumsLanguage | type | The native English or Japanese display language for CrossSums. |
CrossSumsLevel | type | A native difficulty tier for generated CrossSums puzzles. |
CrossSumsMaterial | type | A supported material of the native CrossSums board. |
CrossSumsMount | type | The mounted CrossSums game and progress, native controls and cleanup handle. |
CrossSumsMountOptions | type | The initial CrossSums board, native progress, appearance and host event callbacks. |
CrossSumsPieces | type | A supported native CrossSums mark or piece appearance. |
CrossSumsPuzzle | type | A seeded CrossSums board with its verified solution and native difficulty tier. |
CrossSumsRating | type | How hard a board is, measured by solving it. |
CrossSumsRun | type | One across or down digit run, its clue cell, constituent cells and target sum. |
crossSumsRuns | function | Read across and down digit runs with their clue cells and totals. |
CrossSumsSolve | type | A bounded CrossSums solve result: answer count, first solution, node work and whether the search completed. |
decodeCrossSums | function | Read a native saved CrossSums game, or null for invalid board data or progress. |
drawCrossSums | function | Render the CrossSums board and supplied current state as native SVG text. |
encodeCrossSums | function | Encode the CrossSums board and current game as native resumable text. |
enterCrossSums | function | Apply the requested native CrossSums entry or mark to a new immutable game; invalid or fixed targets stay unchanged. |
finishedCrossSums | function | Whether this CrossSums game satisfies its complete native rules. |
generateCrossSums | function | Makes a seeded board of size squares a side (counting the row and column of totals) and proves it has one answer. |
hintCrossSums | function | Find a native CrossSums hint, or null when no actionable hint is available. |
isCrossSumsBoard | function | Whether the value has valid native CrossSums dimensions, clues and data. |
mountCrossSums | function | Mount the native CrossSums player in a host element and return its cleanup and control handle. |
newCrossSums | function | Create the initial immutable CrossSums game from a valid board. |
progressCrossSums | function | Allows unfinished runs while flagging duplicate digits and impossible remaining totals. |
rateCrossSums | function | Rates a board with one answer by solving it: with the single-run rules, with the digit-that-must-appear rule, then by supposing. |
restartCrossSums | function | Return the CrossSums game reset to its initial entries or marks. |
solveCrossSums | function | Bounded exact counter over across and down runs; an interrupted search never proves uniqueness. |
undoCrossSums | function | Return the CrossSums game with its previous marks or entries restored, or unchanged when there is no undo history. |