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

Cross Sums rules

import { … } from "@johnmorrisdotca/kazu/cross-sums";

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

Exports

NameKindWhat it is
canReachfunctionWhether the remaining distinct digits can reach the target sum in the given slots.
checkCrossSumsfunctionChecks exact run sums and distinct digits independently of a stored answer.
CROSS_SUMS_GENERATION_ATTEMPTSconstantThe native CrossSums generation-attempt limit.
CROSS_SUMS_GENERATION_NODESconstantThe native CrossSums search-node budget.
CROSS_SUMS_LEAST_GENERATED_SIDEconstantThe minimum supported CrossSums board dimension for generation.
CROSS_SUMS_LEVELSconstantHow hard a puzzle is made, by what a person must do to solve it; see rateCrossSums.
CROSS_SUMS_MAX_ATTEMPTSconstantThe native CrossSums generation-attempt limit.
CROSS_SUMS_MAX_NODESconstantThe native CrossSums search-node budget.
CROSS_SUMS_MAX_SIDEconstantThe maximum supported CrossSums board dimension.
CROSS_SUMS_MIN_SIDEconstantThe minimum supported CrossSums board dimension.
CROSS_SUMS_PLAY_STYLEconstantScoped native CrossSums board and player CSS.
CROSS_SUMS_SIZESconstantThe sides on offer, counting the row and column of totals; any side from 5 to CROSS_SUMS_MAX_SIDE can be made.
CROSS_SUMS_STRINGSconstantNative English and Japanese labels and announcements for CrossSums.
CrossSumsBoardtypeCrossSums dimensions and printed clues in their native row-major representation.
CrossSumsCelltypeA white digit cell or a black clue cell with optional across/down totals.
CrossSumsChecktypeThe CrossSums completion result and cells that violate its native rules.
CrossSumsDrawOptionstypeCurrent CrossSums marks or entries, selection, errors and native SVG appearance choices.
CrossSumsGametypeThe immutable CrossSums board, current entries or marks, undo history and assistance state.
CrossSumsLanguagetypeThe native English or Japanese display language for CrossSums.
CrossSumsLeveltypeA native difficulty tier for generated CrossSums puzzles.
CrossSumsMaterialtypeA supported material of the native CrossSums board.
CrossSumsMounttypeThe mounted CrossSums game and progress, native controls and cleanup handle.
CrossSumsMountOptionstypeThe initial CrossSums board, native progress, appearance and host event callbacks.
CrossSumsPiecestypeA supported native CrossSums mark or piece appearance.
CrossSumsPuzzletypeA seeded CrossSums board with its verified solution and native difficulty tier.
CrossSumsRatingtypeHow hard a board is, measured by solving it.
CrossSumsRuntypeOne across or down digit run, its clue cell, constituent cells and target sum.
crossSumsRunsfunctionRead across and down digit runs with their clue cells and totals.
CrossSumsSolvetypeA bounded CrossSums solve result: answer count, first solution, node work and whether the search completed.
decodeCrossSumsfunctionRead a native saved CrossSums game, or null for invalid board data or progress.
drawCrossSumsfunctionRender the CrossSums board and supplied current state as native SVG text.
encodeCrossSumsfunctionEncode the CrossSums board and current game as native resumable text.
enterCrossSumsfunctionApply the requested native CrossSums entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
finishedCrossSumsfunctionWhether this CrossSums game satisfies its complete native rules.
generateCrossSumsfunctionMakes a seeded board of size squares a side (counting the row and column of totals) and proves it has one answer.
hintCrossSumsfunctionFind a native CrossSums hint, or null when no actionable hint is available.
isCrossSumsBoardfunctionWhether the value has valid native CrossSums dimensions, clues and data.
mountCrossSumsfunctionMount the native CrossSums player in a host element and return its cleanup and control handle.
newCrossSumsfunctionCreate the initial immutable CrossSums game from a valid board.
progressCrossSumsfunctionAllows unfinished runs while flagging duplicate digits and impossible remaining totals.
rateCrossSumsfunctionRates a board with one answer by solving it: with the single-run rules, with the digit-that-must-appear rule, then by supposing.
restartCrossSumsfunctionReturn the CrossSums game reset to its initial entries or marks.
solveCrossSumsfunctionBounded exact counter over across and down runs; an interrupted search never proves uniqueness.
undoCrossSumsfunctionReturn the CrossSums 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.