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

Number-puzzle engines

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

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

Kazu 数: the Numbers family of grid puzzles. Sudoku, Jigsaw Sudoku, Diagonal Sudoku, Killer Sudoku (Sum Cages), Futoshiki (More or Less) and Skyscrapers (Towers): a seeded generator whose every puzzle has exactly one answer, at three levels; a solver that counts answers; a check that reads a finished grid in O(cells); a hint that says which cell to fill next and why; puzzles and runs as short codes; and a game in play as pure functions. The drawing is @johnmorrisdotca/kazu/draw, playing in a page is @johnmorrisdotca/kazu/play, and the tag is @johnmorrisdotca/kazu/element/define.

Exports

NameKindWhat it is
AKARI_DENSER_ATTEMPTSconstantThe native Akari generation-attempt limit for each denser fallback.
AKARI_DENSER_CROWDSconstantWhen a level finds no board in AKARI_MOST_ATTEMPTS plain attempts (a large board of an easy level, mostly: one attempt in a hundred succeeds on a 14×14), the generator tries again with more black squares, each of these multiples of the usual share in turn, AKARI_DENSER_ATTEMPTS attempts at each.
AKARI_LEVELSconstantHow hard a puzzle is made, by what a person must do to solve it; see rateAkari.
AKARI_MOST_ATTEMPTSconstantThe native Akari generation-attempt limit.
AKARI_MOST_NODESconstantThe native Akari search-node budget.
AKARI_MOST_SIDEconstantThe maximum supported Akari board dimension.
AKARI_PLAY_STYLEconstantScoped native Akari board and player CSS.
AKARI_SIZESconstantThe sides the demo and the site offer for a square board; any side from 2 to AKARI_MOST_SIDE can be made.
AKARI_STRINGSconstantNative English and Japanese labels and announcements for Akari.
AkariBoardtypeA board is row-major.
AkariChecktypeThe Akari completion result and cells that violate its native rules.
AkariDrawOptionstypeCurrent Akari marks or entries, selection, errors and native SVG appearance choices.
akariFinishedfunctionA game is finished only when its bulbs satisfy every rule and light every white square.
AkariGametypeThe immutable Akari board, current entries or marks, undo history and assistance state.
AkariLanguagetypeThe native English or Japanese display language for Akari.
AkariLeveltypeA native difficulty tier for generated Akari puzzles.
AkariMaterialtypeA supported material of the native Akari board.
AkariMounttypeThe mounted Akari game and progress, native controls and cleanup handle.
AkariMountOptionstypeThe initial Akari board, native progress, appearance and host event callbacks.
akariNeighboursfunctionReturns the orthogonally adjacent cells to a board position.
AkariPiecestypeA supported native Akari mark or piece appearance.
AkariProgresstypeThe Akari constraint status of a partial board.
AkariPuzzletypeA seeded Akari board with its verified solution and native difficulty tier.
AkariRatingtypeHow hard a board is, measured by solving it.
AkariSolvetypeA bounded Akari solve result: answer count, first solution, node work and whether the search completed.
akariVisiblefunctionWhite squares visible from a cell, including itself, stopping at black squares and edges.
answerOffunctionThe whole grid as a cells code: what checkKazu takes as an answer.
boxedLayoutfunctionRows, columns and boxes; with diagonal, the two long diagonals as well.
BoxestypeWhere the boxes are on a Sudoku grid: how many rows and columns of cells each box holds.
boxOffunctionThe box a cell is in, numbered row-major from 0.
CagetypeA cage: the cells in it and the sum of the numbers inside.
CAGE_LETTERSconstantThe letters that name a cage in a code: up to sixty-two cages.
cageOutlinefunctionTHE DASHED OUTLINE OF EVERY CAGE, as line segments in cell units: each cage drawn a little inside its own edge, the way a printed Killer Sudoku draws it, so a cage reads as a shape within the box rules rather than as one of them.
canReachfunctionWhether the remaining distinct digits can reach the target sum in the given slots.
checkAkarifunctionChecks a complete placement from the public rules, without consulting a stored answer.
checkCrossSumsfunctionChecks exact run sums and distinct digits independently of a stored answer.
checkHeyawakefunctionValidate a Heyawake answer against the printed clues and complete native rules.
checkHitorifunctionChecks unshaded row and column duplicates, adjacent shades, and white connectivity.
checkJuosanfunctionChecks public rules directly, independently of the solver and stored answer.
checkKazufunctionWhether an answer solves a puzzle: O(cells), no search, nothing remembered between calls.
checkLoopfunctionChecks all numbered cells, degree-two vertices, and one connected closed loop.
checkMasyufunctionValidate a Masyu answer against the printed clues and complete native rules.
checkNurikabefunctionChecks island areas and separation, the connected sea, and the ban on 2×2 sea blocks.
checkRegionsfunctionChecks region connectivity and area without consulting a generated answer.
checkRipplefunctionChecks room permutations and the at-least-N-cell gap between equal N clues in a line.
checkRoomSpansfunctionAdd unshaded straight-line room-span violations to the supplied error set.
checkShikakufunctionA finished partition is checked against the rules, never against a stored answer.
checkYajilinfunctionValidate a Yajilin answer against the printed clues and complete native rules.
clearCellfunctionEmpty a cell of its number and its pencil marks.
cluesOffunctionEvery clue a finished square makes true: what each side of it sees.
conflictsOffunctionTHE CELLS THAT BREAK A RULE RIGHT NOW, read from the rules alone: no answer is needed, so it works on any puzzle, and it names a mistake the moment it is made rather than when it is checked.
countKazuSolutionsfunctionHow many answers a puzzle has, up to limit (two by default, so "many" costs no more than "two"): 1 is a puzzle, 0 is a grid that cannot be finished, 2 is a guessing game.
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.
decodeAkarifunctionDecodes a bounded save after validating the board and each placement.
decodeCellsfunction".3.1" at a side of 2 → [0, 3, 0, 1], or null for a string that is not a grid of that size: the wrong length, a value past the side, a stray character.
decodeCrossSumsfunctionRead a native saved CrossSums game, or null for invalid board data or progress.
decodeHeyawakefunctionRead a native saved Heyawake game, or null for invalid board data or progress.
decodeHitorifunctionRead a native saved Hitori game, or null for invalid board data or progress.
decodeJigsawfunctionThe cells and regions a Jigsaw's givens say, or null for a string that is not a Jigsaw of this side.
decodeJuosanfunctionReads a bounded public save; malformed or incompatible data returns null.
decodeKillerfunctionThe cells and cages a code says, or null for one that is not a whole, well-formed puzzle: every cell named to a cage, every cage used, and a sum for each.
decodeLoopfunctionRead a native saved Loop game, or null for invalid board data or progress.
decodeMasyufunctionRead a native saved Masyu game, or null for invalid board data or progress.
decodeMoreOrLessfunctionDecode native Futoshiki numbers and less-than relations, or null for an invalid code.
decodeNotesfunctionThe pencil marks a code says (each cell a bit mask, bit v for the number v), or null for a code that is not one for a grid of this side.
decodeNurikabefunctionRead a native saved Nurikabe game, or null for invalid board data or progress.
decodeRegionsfunctionRegions row-major, one letter each, or null for a string that is not that.
decodeRegionsGamefunctionRead a native saved Regions game, or null for invalid board data or progress.
decodeRipplefunctionRead a native saved Ripple game, or null for invalid board data or progress.
decodeRunfunctionThe entries a run's code says, or null for a code that is not a run of this side.
decodeShikakufunctionRead a native saved Shikaku game, or null for invalid board data or progress.
decodeStepsfunctionThe grids a step log holds, each cells characters long, or null for a log that does not read as one.
decodeTowersfunctionThe cells and clues a code says, or null for a string that is not a Towers puzzle of this size.
decodeYajilinfunctionRead a native saved Yajilin game, or null for invalid board data or progress.
drawAkarifunctionDraws the public clues and current bulbs as SVG.
drawCrossSumsfunctionRender the CrossSums board and supplied current state as native SVG text.
drawHeyawakefunctionRender the Heyawake board and supplied current state as native SVG text.
drawJuosanfunctionDraws a public Juosan board as an SVG string.
drawLoopfunctionDraws public clues and selected loop edges as an SVG board.
drawRegionsfunctionRender the Regions board and supplied current state as native SVG text.
drawRipplefunctionRender the Ripple board and supplied current state as native SVG text.
edgeVerticesfunctionRead the two vertex indices at the ends of a native Loop edge.
EMPTY_CELLconstantA GRID OF NUMBERS AS A STRING: for an address, a POST body, and a kept run.
encodeAkarifunctionEncodes only public clues and player placements.
encodeCellsfunction[0, 3, 0, 1] → ".3.1".
encodeCrossSumsfunctionEncode the CrossSums board and current game as native resumable text.
encodeHeyawakefunctionEncode the Heyawake board and current game as native resumable text.
encodeHitorifunctionVersioned public clue and mark data; the generated answer is not saved.
encodeJigsawfunctionA Jigsaw's givens: the cells, then the regions, one letter a cell.
encodeJuosanfunctionSerializes public clues, placements, and assisted status.
encodeKillerfunctionA Sum Cages puzzle's givens: the cells, then which cage each cell is in, then each cage's sum.
encodeLoopfunctionEncode the Loop board and current game as native resumable text.
encodeMasyufunctionEncode the Masyu board and current game as native resumable text.
encodeMoreOrLessfunctionEncode grid numbers and less-than relations as the native Futoshiki givens code.
encodeNotesfunctionPencil marks as a code: for each cell that has any, its index in base 36 (two characters) and its marks as one number in base 36 (four characters); nothing at all for a grid with none.
encodeNurikabefunctionEncode the Nurikabe board and current game as native resumable text.
encodeRegionsfunctionThe region of every cell as a letter, a for the first region and so on: one character a cell.
encodeRegionsGamefunctionEncode the Regions board and current game as native resumable text.
encodeRipplefunctionEncode the Ripple board and current game as native resumable text.
encodeRunfunctionThe entries of a run as its code.
encodeShikakufunctionVersioned public puzzle and placement data, with no hidden answer.
encodeStepsfunctionTHE STEPS OF A PUZZLE, written down so a scrubber has them when the puzzle is picked up again.
encodeTowersfunctionEncode grid numbers and four sides of visibility clues as native Skyscrapers givens.
encodeYajilinfunctionEncode the Yajilin 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.
enterNumberfunctionWrite a number into a cell (0 empties it).
entryRegionsfunctionGroup connected cells carrying the same entry into candidate regions.
finishedCrossSumsfunctionWhether this CrossSums game satisfies its complete native rules.
freshKazuSeedfunctionA new seed, from Math.random or the stream given: anywhere in the range.
gameConflictsfunctionThe cells that break a rule now (conflictsOf).
generateAkarifunctionMakes a seeded board and proves it has one answer.
generateCrossSumsfunctionMakes a seeded board of size squares a side (counting the row and column of totals) and proves it has one answer.
generateDiagonalfunctionA Diagonal Sudoku (Sudoku X): Sudoku with the two long diagonals as groups too.
generateHeyawakefunctionGenerate a seeded Heyawake puzzle with a verified unique answer; unsupported inputs or exhausted attempts throw.
generateHitorifunctionMakes a seeded puzzle and proves its answer is the only one.
generateJigsawfunctionA Jigsaw Sudoku of this side, level and seed: 5, 6, 7 or 9.
generateJuosanfunctionMakes an original small training puzzle and returns it only after uniqueness is proved.
generateKazufunctionA puzzle of any of the six, from a seed: the one door.
generateLoopfunctionMakes a seeded puzzle and proves it has one answer.
generateMasyufunctionSeeded original loop layouts; every output is accepted only after a completed uniqueness proof.
generateMoreOrLessfunctionA Futoshiki (More or Less) of this side, level and seed: 4, 5, 6 or 7.
generateNumberPlacefunctionA Sudoku (Number Place) of this side, level and seed: 4, 6, 9, 16 or 25.
generateNurikabefunctionSeeded symmetries of original 5×5 layouts are returned only after the solver proves uniqueness.
generateRegionsfunctionMakes a seeded puzzle and proves its answer is the only one.
generateRipplefunctionBuilds a seeded block-room family and accepts it only after a bounded uniqueness proof.
generateShikakufunctionSeeded rectangles packed into the board, one number each, with an independently counted, unique answer.
generateShikakuChallengefunctionGenerate a seeded Shikaku puzzle with a verified unique answer; unsupported inputs or exhausted attempts throw.
generateSumCagesfunctionA Killer Sudoku (Sum Cages) of this side, level and seed: 6 or 9.
generateTowersfunctionA Skyscrapers (Towers) puzzle of this side, level and seed: 4, 5, 6 or 7.
generateYajilinfunctionSeeded original 5×5 families, accepted only after a completed uniqueness proof.
HEYAWAKE_GENERATOR_MOST_CELLSconstantThe maximum number of cells accepted by the Heyawake generator.
HEYAWAKE_LEVELSconstantThe native Heyawake generation difficulty tiers.
HEYAWAKE_MOST_ATTEMPTSconstantThe native Heyawake generation-attempt limit.
HEYAWAKE_MOST_NODESconstantThe native Heyawake search-node budget.
HEYAWAKE_MOST_SIDEconstantThe maximum supported Heyawake board dimension.
HEYAWAKE_PLAY_STYLEconstantScoped native Heyawake board and player CSS.
HeyawakeAppearancetypeLanguage, material and marks for a native Heyawake board.
HeyawakeBoardtypeHeyawake dimensions and printed clues in their native row-major representation.
heyawakeCellsfunctionRead room cells, or null for a room outside this board.
HeyawakeChecktypeThe Heyawake completion result and cells that violate its native rules.
HeyawakeDrawOptionstypeCurrent Heyawake marks or entries, selection, errors and native SVG appearance choices.
heyawakeFinishedfunctionWhether this Heyawake game satisfies its complete native rules.
HeyawakeGametypeThe immutable Heyawake board, current entries or marks, undo history and assistance state.
HeyawakeLeveltypeA native difficulty tier for generated Heyawake puzzles.
HeyawakeMounttypeThe mounted Heyawake game and progress, native controls and cleanup handle.
HeyawakeMountOptionstypeThe initial Heyawake board, native progress, appearance and host event callbacks.
heyawakeNeighboursfunctionRead orthogonally adjacent Heyawake cells.
HeyawakePuzzletypeA seeded Heyawake board with its verified solution and native difficulty tier.
HeyawakeRoomtypeA rectangular room and its optional required black-cell count.
HeyawakeSolvetypeA bounded Heyawake solve result: answer count, first solution, node work and whether the search completed.
heyawakeWordsfunctionRead the native English or Japanese Heyawake labels.
hintAkarifunctionReturns a missing bulb, or an extra bulb to remove, only after uniqueness is proved.
hintCrossSumsfunctionFind a native CrossSums hint, or null when no actionable hint is available.
hintHeyawakefunctionFind a native Heyawake hint, or null when no actionable hint is available.
hintHitorifunctionGives one next shade in the unique minimal solution, if uniqueness was proved.
hintJuosanfunctionReturns one next mark only when the public clues prove a unique answer.
hintKazufunctionThe next cell a person could fill in, and why (see KazuHint).
hintLoopfunctionFind a native Loop hint, or null when no actionable hint is available.
hintMasyufunctionFind a native Masyu hint, or null when no actionable hint is available.
hintNurikabefunctionFind a native Nurikabe hint, or null when no actionable hint is available.
hintRegionsfunctionFind a native Regions hint, or null when no actionable hint is available.
hintRipplefunctionOffers a cell only when the current public entries leave one proved completion.
hintShikakufunctionA rectangle is offered only when the remaining partition has one proved answer.
hintYajilinfunctionFind a native Yajilin hint, or null when no actionable hint is available.
HITORI_LEAST_SIDEconstantThe minimum supported Hitori board dimension.
HITORI_LEVELSconstantHow hard a puzzle is made, by what a person must do to solve it; see rateHitori.
HITORI_MAX_NODESconstantThe native Hitori search-node budget.
HITORI_MOST_ATTEMPTSconstantThe native Hitori generation-attempt limit.
HITORI_MOST_SIDEconstantThe maximum supported Hitori board dimension.
HITORI_SIZESconstantThe sides on offer; any side from 4 to HITORI_MOST_SIDE is a board isHitoriBoard takes.
HitoriBoardtypeHitori dimensions and printed clues in their native row-major representation.
HitoriGametypeThe immutable Hitori board, current entries or marks, undo history and assistance state.
HitoriLeveltypeA native difficulty tier for generated Hitori puzzles.
hitoriNeighborsfunctionRead orthogonally adjacent cells on a square Hitori board.
HitoriPuzzletypeA seeded Hitori board with its verified solution and native difficulty tier.
HitoriRatingtypeHow hard a board is, measured by solving it.
HitoriSolvetypeA bounded Hitori solve result: answer count, first solution, node work and whether the search completed.
isAkariBoardfunctionValidates dimensions and the three public square kinds.
isCrossSumsBoardfunctionWhether the value has valid native CrossSums dimensions, clues and data.
isHeyawakeBoardfunctionWhether the value has valid native Heyawake dimensions, clues and data.
isHitoriBoardfunctionWhether the value has valid native Hitori dimensions, clues and data.
isJuosanBoardfunctionWhether territories partition a bounded board and each territory is connected.
isKazuGivensfunctionWhether a puzzle's givens are a well-formed puzzle of that kind and side at all (a Jigsaw's regions sound, every code readable).
isKazuKindfunctionWhether a value is one of the six keys.
isKazuLevelfunctionWhether a value is one of the three levels.
isKazuSeedfunctionWhether a value is a seed this package takes: a whole number from 1 to KAZU_SEED_MOST.
isKazuSizefunctionWhether this puzzle can be made at this side.
isLoopBoardfunctionWhether the value has valid native Loop dimensions, clues and data.
isMasyuBoardfunctionWhether the value has valid native Masyu dimensions, clues and data.
isNurikabeBoardfunctionWhether the value has valid native Nurikabe dimensions, clues and data.
isPrintedfunctionWhether a cell was printed with its number: it never changes.
isRegionsBoardfunctionWhether the value has valid native Regions dimensions, clues and data.
isRippleBoardfunctionWhether the value has valid native Ripple dimensions, clues and data.
isShikakuBoardfunctionWhether dimensions and area clues describe a possible partition.
isSolvedfunctionWhether the grid is full and right, by the rules alone (checkKazu): every puzzle has exactly one answer, so a grid that keeps every rule IS that answer.
isYajilinBoardfunctionWhether the value has valid native Yajilin dimensions, clues and data.
JUOSAN_LEVELSconstantThe native Juosan generation difficulty tiers.
JUOSAN_MOST_ATTEMPTSconstantThe native Juosan generation-attempt limit.
JUOSAN_MOST_NODESconstantThe native Juosan search-node budget.
JUOSAN_MOST_SIDEconstantThe maximum supported Juosan board dimension.
JUOSAN_PLAY_STYLEconstantScoped native Juosan board and player CSS.
JUOSAN_STRINGSconstantNative English and Japanese labels and announcements for Juosan.
JuosanBoardtypeJuosan dimensions and printed clues in their native row-major representation.
JuosanChecktypeThe Juosan completion result and cells that violate its native rules.
JuosanDrawOptionstypeCurrent Juosan marks or entries, selection, errors and native SVG appearance choices.
juosanFinishedfunctionWhether every cell is filled and the independent checker accepts the board.
JuosanGametypeThe immutable Juosan board, current entries or marks, undo history and assistance state.
JuosanLanguagetypeThe native English or Japanese display language for Juosan.
JuosanLeveltypeA native difficulty tier for generated Juosan puzzles.
JuosanMarktypeA blank, horizontal or vertical mark in a Juosan cell.
JuosanMaterialtypeA supported material of the native Juosan board.
JuosanMounttypeThe mounted Juosan game and progress, native controls and cleanup handle.
JuosanMountOptionstypeThe initial Juosan board, native progress, appearance and host event callbacks.
JuosanPiecestypeA supported native Juosan mark or piece appearance.
JuosanPuzzletypeA seeded Juosan board with its verified solution and native difficulty tier.
JuosanSolvetypeA bounded Juosan solve result: answer count, first solution, node work and whether the search completed.
JuosanTerritorytypeA territory is a list of zero-based cell indexes and an absolute orientation difference.
juosanTerritoryAtfunctionReturns the index of the territory containing a cell, or -1 when absent.
KAZU_BOXESconstantA 9×9 has 3×3 boxes and a 4×4 has 2×2; a 6×6 has boxes two rows tall and three columns wide, which is the one people get wrong and the reason this is a table rather than a square root.
KAZU_KIND_OF_SITE_KINDconstantThe names itsutsu.com gave the six in its code, to the keys here: what a site's stored kind becomes.
KAZU_KINDSconstantTHE SIX PUZZLES, and what each offers: the keys, the sizes and the levels.
KAZU_LEVELSconstantHow hard a puzzle is made: what the solver needed.
KAZU_SEED_MOSTconstantThe most a seed can be: a whole number from 1 to 2³¹ − 1, so it travels in an address as a plain integer.
KAZU_SPECSconstantSupported sizes, native default size and givens-code limits for each number-grid kind.
KAZU_STEPS_KEPTconstantHow many grids a step log keeps: the newest, so a long puzzle's log has a ceiling.
KazuChecktypeThe verdict on a submitted answer: { ok: true }, or { ok: false, reason } in the words the site has always used.
kazuClockTextfunctionA time taken, as a clock shows it: m:ss, and h:mm:ss past an hour.
KazuGametypeA PUZZLE IN PLAY, as pure functions: what has been written, the pencil marks, and how to take a step back.
KazuGameOptionstypeOptional entries and pencil-note masks to restore when creating a native number-grid game.
KazuGivenstypeWHAT A PUZZLE WAS PRINTED WITH, read from its givens code: the printed cells, and for a Jigsaw its regions, for Sum Cages its cages, for More or Less its marks, for Towers its clues.
kazuGuessDepthfunctionHow many guesses, each followed by everything reasoning then finds, a person needs to finish the puzzle: 0 when reasoning alone finishes it (easy), 1 when one guess does (medium), more when more (hard); Infinity when there is no answer.
kazuHashfunctionA short fingerprint of a puzzle's givens (FNV-1a, eight hex characters): the same puzzle, however it was kept, has the same one.
KazuHinttypeA HINT: the next cell a person could fill in by looking, and why.
KazuKindtypeOne of the six native number-grid puzzle kinds.
KazuLeveltypeOne of the native easy, medium or hard generation tiers.
kazuProgressfunctionHow far along it is: cells with a number (printed or written) out of all of them.
KazuPuzzletypeOne puzzle, made from a seed or read back from its codes.
KazuSpectypeWhat one puzzle offers.
layoutOfGivensfunctionThe groups that must each hold every number once, for the four kinds made of groups; null for More or Less and Towers, which only have rows and columns.
lineFromfunctionThe cells a clue looks along, nearest first: the clue at at on the top looks down column at, on the bottom up it, on the left along row at to the right, on the right along it to the left.
LOOP_LEVELSconstantHow hard a puzzle is made, by what a person must do to solve it; see rateLoop.
LOOP_MOST_ATTEMPTSconstantThe native Loop generation-attempt limit.
LOOP_MOST_NODESconstantThe native Loop search-node budget.
LOOP_MOST_SIDEconstantThe maximum supported Loop board dimension.
LOOP_SIZESconstantThe sides on offer for a square board; any side from 2 to LOOP_MOST_SIDE can be made.
LoopBoardtypeLoop dimensions and printed clues in their native row-major representation.
loopCellEdgesfunctionRead the four edges around a cell, or null for a cell outside the board.
LoopChecktypeThe Loop completion result and cells that violate its native rules.
LoopDrawOptionstypeCurrent Loop marks or entries, selection, errors and native SVG appearance choices.
loopEdgeCountfunctionAn edge index is horizontal row-major first, then vertical row-major.
loopFinishedfunctionWhether this Loop game satisfies its complete native rules.
LoopGametypeThe immutable Loop board, current entries or marks, undo history and assistance state.
loopHorizontalCountfunctionCount horizontal edges in the Loop board’s native edge numbering.
LoopLanguagetypeThe native English or Japanese display language for Loop.
LoopLeveltypeA native difficulty tier for generated Loop puzzles.
LoopMaterialtypeA supported material of the native Loop board.
LoopMounttypeThe mounted Loop game and progress, native controls and cleanup handle.
LoopMountOptionstypeThe initial Loop board, native progress, appearance and host event callbacks.
LoopProgresstypeThe Loop constraint status of a partial board.
LoopPuzzletypeA seeded Loop board with its verified solution and native difficulty tier.
LoopRatingtypeHow hard a board is, measured by solving it.
LoopSolvetypeA bounded Loop solve result: answer count, first solution, node work and whether the search completed.
loopVertexEdgesfunctionRead edges meeting a native Loop vertex.
MarktypeA mark: the cell at less holds a smaller number than the cell at more.
markNurikabeSeafunctionApply the requested native Nurikabe entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
MASYU_NODE_BUDGETconstantThe native Masyu search-node budget.
MASYU_SIZESconstantThe supported Masyu board sizes.
MasyuBoardtypeMasyu dimensions and printed clues in their native row-major representation.
masyuCellCountfunctionCount cells in a Masyu board.
MasyuChecktypeThe Masyu completion result and cells that violate its native rules.
MasyuDrawOptionstypeCurrent Masyu marks or entries, selection, errors and native SVG appearance choices.
masyuEdgeCountfunctionCount native Masyu edges.
masyuFinishedfunctionWhether this Masyu game satisfies its complete native rules.
MasyuGametypeThe immutable Masyu board, current entries or marks, undo history and assistance state.
MasyuMounttypeThe mounted Masyu game and progress, native controls and cleanup handle.
MasyuMountOptionstypeThe initial Masyu board, native progress, appearance and host event callbacks.
masyuNeighborsfunctionRead adjacent Masyu cells with the joining edge and direction.
MasyuPuzzletypeA seeded Masyu board with its verified solution.
MasyuSolvetypeA bounded Masyu solve result: answer count, first solution, node work and whether the search completed.
mountAkarifunctionMounts the player in a host element; call destroy when the host is removed.
mountCrossSumsfunctionMount the native CrossSums player in a host element and return its cleanup and control handle.
mountHeyawakefunctionMount the native Heyawake player in a host element and return its cleanup and control handle.
mountJuosanfunctionMounts a touch, mouse, and keyboard player into an existing page element.
mountLoopfunctionMounts an accessible dot-and-edge loop player in the given host element.
mountRipplefunctionMount the native Ripple player in a host element and return its cleanup and control handle.
neighboursfunctionThe cells sharing an edge with index.
newAkarifunctionStarts a game with only its public board data.
newCrossSumsfunctionCreate the initial immutable CrossSums game from a valid board.
newHeyawakefunctionCreate the initial immutable Heyawake game from a valid board.
newHitorifunctionCreate the initial immutable Hitori game from a valid board.
newJuosanfunctionStarts a game with a copy of its public board and no generated answer.
newKazuGamefunctionA game of a puzzle, or null for givens that are not a puzzle of that kind and side.
newLoopfunctionCreate the initial immutable Loop game from a valid board.
newMasyufunctionCreate the initial immutable Masyu game from a valid board.
newNurikabefunctionCreate the initial immutable Nurikabe game from a valid board.
newRegionsfunctionCreate the initial immutable Regions game from a valid board.
newRipplefunctionCreate the initial immutable Ripple game from a valid board.
newShikakufunctionBegin with a copy of just the public clues; a generated answer is never kept in play.
newYajilinfunctionCreate the initial immutable Yajilin game from a valid board.
NO_MARKconstantThe native code character for an absent Futoshiki relation.
noCluesfunctionCreate empty visibility clues on all four sides of a square grid.
notesOffunctionEvery value of a pencil-mark mask, smallest first.
numberCountsfunctionThe numbers 1 up to the side, each with how many of it are on the grid: a pad greys a number that is all placed.
NURIKABE_MAX_NODESconstantThe native Nurikabe search-node budget.
NURIKABE_SIZESconstantThe supported Nurikabe board sizes.
NurikabeBoardtypeNurikabe dimensions and printed clues in their native row-major representation.
NurikabeGametypeThe immutable Nurikabe board, current entries or marks, undo history and assistance state.
nurikabeNeighborsfunctionRead orthogonally adjacent cells on a square Nurikabe board.
NurikabePuzzletypeA seeded Nurikabe board with its verified solution.
NurikabeSolvetypeA bounded Nurikabe solve result: answer count, first solution, node work and whether the search completed.
placeShikakufunctionPlace a rectangle, replacing any it touches.
progressAkarifunctionReports immediate contradictions while allowing required clues to remain unsatisfied during play.
progressCrossSumsfunctionAllows unfinished runs while flagging duplicate digits and impossible remaining totals.
progressLoopfunctionReports overfilled clues and branched vertices during play without requiring a finished loop.
progressRipplefunctionPartial progress check; missing entries are allowed, but impossible room/ripple pairs are flagged.
RandomtypeA number in [0, 1), like Math.random, from a stream a seed fixes.
rateAkarifunctionRates a board by solving it as a person would: with the rules alone (depth 0), then with one supposition at a time (depth 1), and anything beyond that is depth 2.
rateCrossSumsfunctionRates a board with one answer by solving it: with the single-run rules, with the digit-that-must-appear rule, then by supposing.
rateHitorifunctionRates a board with one answer by solving it: with the plain rules, with the whites-stay-together rule, then by supposing.
rateLoopfunctionRates a board with one answer by solving it as a person would: with the rules, then by supposing one edge at a time.
rateRegionsfunctionRates a board with one answer by solving it as a person would: with the rules, then by supposing one number at a time.
rateShikakufunctionRates a board with one answer by solving it with the first rule, with the first two, with all three, then by supposing.
readGivensfunctionThe givens of a puzzle, or null for a code that is not one of that kind and side.
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.
regionsAreSoundfunctionWhether region divides a size×size grid into size regions of size cells each, every one of them joined edge to edge.
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.
removeShikakufunctionRemove the rectangle containing a cell.
restartCrossSumsfunctionReturn the CrossSums game reset to its initial entries or marks.
restartHeyawakefunctionReturn the Heyawake game reset to its initial entries or marks.
restartHitorifunctionReturn the Hitori game reset to its initial entries or marks.
restartJuosanfunctionClears the board while retaining whether the player used a hint.
restartKazufunctionStart again: every entry and pencil mark gone, and nothing to undo.
restartMasyufunctionReturn the Masyu game reset to its initial entries or marks.
restartNurikabefunctionReturn the Nurikabe game reset to its initial entries or marks.
restartRegionsfunctionReturn the Regions game reset to its initial entries or marks.
restartYajilinfunctionReturn the Yajilin game reset to its initial entries or marks.
RIPPLE_MAX_ATTEMPTSconstantThe native Ripple generation-attempt limit.
RIPPLE_MAX_NODESconstantThe native Ripple search-node budget.
RIPPLE_MAX_SIDEconstantThe maximum supported Ripple board dimension.
RIPPLE_MIN_SIDEconstantThe minimum supported Ripple board dimension.
RIPPLE_PLAY_STYLEconstantScoped native Ripple board and player CSS.
RIPPLE_STRINGSconstantNative English and Japanese labels and announcements for Ripple.
RippleBoardtypeRipple dimensions and printed clues in their native row-major representation.
RippleChecktypeThe Ripple completion result and cells that violate its native rules.
RippleDrawOptionstypeCurrent Ripple marks or entries, selection, errors and native SVG appearance choices.
rippleFinishedfunctionWhether this Ripple game satisfies its complete native rules.
RippleGametypeThe immutable Ripple board, current entries or marks, undo history and assistance state.
RippleLanguagetypeThe native English or Japanese display language for Ripple.
RippleMaterialtypeA supported material of the native Ripple board.
RippleMounttypeThe mounted Ripple game and progress, native controls and cleanup handle.
RippleMountOptionstypeThe initial Ripple board, native progress, appearance and host event callbacks.
RipplePiecestypeA supported native Ripple mark or piece appearance.
RipplePuzzletypeA seeded Ripple board with its verified solution.
rippleRoomSizesfunctionRead the size of each room in a Ripple Effect board.
RippleSolvetypeA bounded Ripple solve result: answer count, first solution, node work and whether the search completed.
roomForCellfunctionRead the containing room index for each Heyawake cell.
seededRandomfunctionA stream of numbers in [0, 1) fixed by a seed.
SegmenttypeA line segment in cell units: where one part of a cage's dashed outline runs.
setHeyawakeCellfunctionApply the requested native Heyawake entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
setJuosanMarkfunctionWrites a mark and records the previous state; invalid or unchanged moves are ignored.
setRegionsCellfunctionApply the requested native Regions entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
setRippleValuefunctionApply the requested native Ripple entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
shadeHitorifunctionApply the requested native Hitori entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
SHIKAKU_CHALLENGE_PACKSconstantThree short, named challenge routes using the regular seeded unique-puzzle generator.
SHIKAKU_LEVELSconstantHow hard a puzzle is made, by what a person must do to solve it; see rateShikaku.
SHIKAKU_MOST_ATTEMPTSconstantThe native Shikaku generation-attempt limit.
SHIKAKU_MOST_NODESconstantThe native Shikaku search-node budget.
SHIKAKU_MOST_SIDEconstantBounds keep custom boards and searches finite.
SHIKAKU_SIZESconstantThe sides on offer for a square board; any side from 2 to SHIKAKU_MOST_SIDE can be made.
ShikakuBoardtypeOne area clue per rectangle; zero is an unnumbered cell.
shikakuCandidatesfunctionAll legal rectangles for a numbered cell, in a stable order.
shikakuCellsfunctionCells of a bounded rectangle, or null for invalid coordinates.
ShikakuChallengetypeThe named route, board shape, difficulty and seed of one Shikaku challenge.
ShikakuChallengePuzzletypeA named Shikaku challenge paired with its generated unique puzzle.
ShikakuChecktypeThe Shikaku completion result and cells that violate its native rules.
shikakuFinishedfunctionWhether this Shikaku game satisfies its complete native rules.
ShikakuGametypeThe immutable Shikaku board, current entries or marks, undo history and assistance state.
ShikakuLeveltypeA native difficulty tier for generated Shikaku puzzles.
ShikakuPackKeytypeOne of the square, wide or tall native Shikaku challenge routes.
ShikakuPuzzletypeA seeded Shikaku board with its verified solution and native difficulty tier.
ShikakuRatingtypeHow hard a board is, measured by solving it.
ShikakuRectangletypeA rectangle uses zero-based column and row coordinates.
ShikakuSolvetypeA bounded Shikaku solve result: answer count, first solution, node work and whether the search completed.
shuffledfunctionA copy of the list in a random order (Fisher–Yates, from the end); the list given is left alone.
solveAkarifunctionBounded constraint search over the rules in akariLogic.ts; a stopped proof is always marked incomplete.
solveCrossSumsfunctionBounded exact counter over across and down runs; an interrupted search never proves uniqueness.
solveHeyawakefunctionSearch for Heyawake answers up to the solution and node limits; completion distinguishes a proved result from exhausted work.
solveHitorifunctionCounts distinct minimal shade patterns: an answer shades only squares that settle a duplicate, so extra shades are never a second answer.
solveJuosanfunctionCounts labeled solutions up to a limit; complete distinguishes exhaustion from cutoff.
solveKazufunctionThe one answer a puzzle's givens allow, as a cells code, or null when they allow none, more than one, or the search ran past budget steps (Sudoku, Jigsaw, Diagonal and Sum Cages).
solveLoopfunctionCounts loop solutions with the pruning in loopLogic.ts under explicit work bounds.
solveMasyufunctionCounts distinct single loops with local pearl rules; budget stops never claim a proof.
solveNurikabefunctionCounts valid island placements and checks the remaining cells as the sea under a finite budget.
solveRegionsfunctionCounts completed partitions.
solveRipplefunctionCounts rule-valid fillings within an explicit node budget.
solveShikakufunctionExact cover over squares.
solveYajilinfunctionCounts public shade patterns whose remaining cells form the single required loop.
stepEntryfunctionThe number a tap on the chosen cell puts in it: one more, and after the largest the cell empties, and then it starts again at 1.
symbolOffunctionHow a value is written, in a code and on a cell: 1–9, then A–P.
toggleAkarifunctionToggles a bulb on a white square and keeps one prior turn for undo.
toggleLoopfunctionApply the requested native Loop entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
toggleMasyuEdgefunctionApply the requested native Masyu entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
toggleNotefunctionTurn the pencil mark value on or off in a cell.
toggleRippleNotefunctionApply the requested native Ripple entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
toggleYajilinEdgefunctionApply the requested native Yajilin entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
toggleYajilinShadefunctionApply the requested native Yajilin entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
TOWER_SIDESconstantTowers (Skyscrapers) as a string: the cells, then the clues around the edge.
TowerCluestypeEach side's clues, in reading order along it; 0 where there is none.
TowerSidetypeThe top, bottom, left or right side of Skyscrapers visibility clues.
towersSeenfunctionHow many towers show looking along heights from its first end: each one taller than every one before it.
undoAkarifunctionRestores the last bulb placement.
undoCrossSumsfunctionReturn the CrossSums game with its previous marks or entries restored, or unchanged when there is no undo history.
undoHeyawakefunctionReturn the Heyawake game with its previous marks or entries restored, or unchanged when there is no undo history.
undoHitorifunctionReturn the Hitori game with its previous marks or entries restored, or unchanged when there is no undo history.
undoJuosanfunctionRestores the preceding mark state, if one exists.
undoKazufunctionTake back the last change.
undoLoopfunctionReturn the Loop game with its previous marks or entries restored, or unchanged when there is no undo history.
undoMasyufunctionReturn the Masyu game with its previous marks or entries restored, or unchanged when there is no undo history.
undoNurikabefunctionReturn the Nurikabe game with its previous marks or entries restored, or unchanged when there is no undo history.
undoRegionsfunctionReturn the Regions game with its previous marks or entries restored, or unchanged when there is no undo history.
undoRipplefunctionReturn the Ripple game with its previous marks or entries restored, or unchanged when there is no undo history.
undoShikakufunctionReturn the Shikaku game with its previous marks or entries restored, or unchanged when there is no undo history.
undoYajilinfunctionReturn the Yajilin game with its previous marks or entries restored, or unchanged when there is no undo history.
valueOfSymbolfunctionThe value a symbol names, or 0 for one that is not 1–9 or A–P (either case).
valuesOffunctionThe whole grid as it stands: the printed numbers, and the player's where nothing is printed.
VERSIONconstantThe package's version.
YAJILIN_NODE_BUDGETconstantThe native Yajilin search-node budget.
YAJILIN_SIZESconstantThe supported Yajilin board sizes.
YajilinBoardtypeYajilin dimensions and printed clues in their native row-major representation.
YajilinChecktypeThe Yajilin completion result and cells that violate its native rules.
YajilinCluetypeAn arrow direction and the required number of shaded cells in its ray.
YajilinDirectiontypeThe direction an arrow clue looks along a row or column.
YajilinDrawOptionstypeCurrent Yajilin marks or entries, selection, errors and native SVG appearance choices.
yajilinEdgeCountfunctionCount native Yajilin edges.
YajilinGametypeThe immutable Yajilin board, current entries or marks, undo history and assistance state.
YajilinMounttypeThe mounted Yajilin game and progress, native controls and cleanup handle.
YajilinMountOptionstypeThe initial Yajilin board, native progress, appearance and host event callbacks.
yajilinNeighborsfunctionRead adjacent Yajilin cells and the joining edge.
YajilinPuzzletypeA seeded Yajilin board with its verified solution.
yajilinRayfunctionRead cells in the arrow’s indicated direction, excluding its own clue cell.
YajilinSolutiontypeThe solved Yajilin shading and loop edges.
YajilinSolvetypeA bounded Yajilin solve result: answer count, first solution, node work and whether the search completed.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kazu 2.1.0.