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
| Name | Kind | What it is |
|---|---|---|
AKARI_DENSER_ATTEMPTS | constant | The native Akari generation-attempt limit for each denser fallback. |
AKARI_DENSER_CROWDS | constant | When 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_LEVELS | constant | How hard a puzzle is made, by what a person must do to solve it; see rateAkari. |
AKARI_MOST_ATTEMPTS | constant | The native Akari generation-attempt limit. |
AKARI_MOST_NODES | constant | The native Akari search-node budget. |
AKARI_MOST_SIDE | constant | The maximum supported Akari board dimension. |
AKARI_PLAY_STYLE | constant | Scoped native Akari board and player CSS. |
AKARI_SIZES | constant | The sides the demo and the site offer for a square board; any side from 2 to AKARI_MOST_SIDE can be made. |
AKARI_STRINGS | constant | Native English and Japanese labels and announcements for Akari. |
AkariBoard | type | A board is row-major. |
AkariCheck | type | The Akari completion result and cells that violate its native rules. |
AkariDrawOptions | type | Current Akari marks or entries, selection, errors and native SVG appearance choices. |
akariFinished | function | A game is finished only when its bulbs satisfy every rule and light every white square. |
AkariGame | type | The immutable Akari board, current entries or marks, undo history and assistance state. |
AkariLanguage | type | The native English or Japanese display language for Akari. |
AkariLevel | type | A native difficulty tier for generated Akari puzzles. |
AkariMaterial | type | A supported material of the native Akari board. |
AkariMount | type | The mounted Akari game and progress, native controls and cleanup handle. |
AkariMountOptions | type | The initial Akari board, native progress, appearance and host event callbacks. |
akariNeighbours | function | Returns the orthogonally adjacent cells to a board position. |
AkariPieces | type | A supported native Akari mark or piece appearance. |
AkariProgress | type | The Akari constraint status of a partial board. |
AkariPuzzle | type | A seeded Akari board with its verified solution and native difficulty tier. |
AkariRating | type | How hard a board is, measured by solving it. |
AkariSolve | type | A bounded Akari solve result: answer count, first solution, node work and whether the search completed. |
akariVisible | function | White squares visible from a cell, including itself, stopping at black squares and edges. |
answerOf | function | The whole grid as a cells code: what checkKazu takes as an answer. |
boxedLayout | function | Rows, columns and boxes; with diagonal, the two long diagonals as well. |
Boxes | type | Where the boxes are on a Sudoku grid: how many rows and columns of cells each box holds. |
boxOf | function | The box a cell is in, numbered row-major from 0. |
Cage | type | A cage: the cells in it and the sum of the numbers inside. |
CAGE_LETTERS | constant | The letters that name a cage in a code: up to sixty-two cages. |
cageOutline | function | THE 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. |
canReach | function | Whether the remaining distinct digits can reach the target sum in the given slots. |
checkAkari | function | Checks a complete placement from the public rules, without consulting a stored answer. |
checkCrossSums | function | Checks exact run sums and distinct digits independently of a stored answer. |
checkHeyawake | function | Validate a Heyawake answer against the printed clues and complete native rules. |
checkHitori | function | Checks unshaded row and column duplicates, adjacent shades, and white connectivity. |
checkJuosan | function | Checks public rules directly, independently of the solver and stored answer. |
checkKazu | function | Whether an answer solves a puzzle: O(cells), no search, nothing remembered between calls. |
checkLoop | function | Checks all numbered cells, degree-two vertices, and one connected closed loop. |
checkMasyu | function | Validate a Masyu answer against the printed clues and complete native rules. |
checkNurikabe | function | Checks island areas and separation, the connected sea, and the ban on 2×2 sea blocks. |
checkRegions | function | Checks region connectivity and area without consulting a generated answer. |
checkRipple | function | Checks room permutations and the at-least-N-cell gap between equal N clues in a line. |
checkRoomSpans | function | Add unshaded straight-line room-span violations to the supplied error set. |
checkShikaku | function | A finished partition is checked against the rules, never against a stored answer. |
checkYajilin | function | Validate a Yajilin answer against the printed clues and complete native rules. |
clearCell | function | Empty a cell of its number and its pencil marks. |
cluesOf | function | Every clue a finished square makes true: what each side of it sees. |
conflictsOf | function | THE 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. |
countKazuSolutions | function | How 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_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. |
decodeAkari | function | Decodes a bounded save after validating the board and each placement. |
decodeCells | function | ".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. |
decodeCrossSums | function | Read a native saved CrossSums game, or null for invalid board data or progress. |
decodeHeyawake | function | Read a native saved Heyawake game, or null for invalid board data or progress. |
decodeHitori | function | Read a native saved Hitori game, or null for invalid board data or progress. |
decodeJigsaw | function | The cells and regions a Jigsaw's givens say, or null for a string that is not a Jigsaw of this side. |
decodeJuosan | function | Reads a bounded public save; malformed or incompatible data returns null. |
decodeKiller | function | The 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. |
decodeLoop | function | Read a native saved Loop game, or null for invalid board data or progress. |
decodeMasyu | function | Read a native saved Masyu game, or null for invalid board data or progress. |
decodeMoreOrLess | function | Decode native Futoshiki numbers and less-than relations, or null for an invalid code. |
decodeNotes | function | The 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. |
decodeNurikabe | function | Read a native saved Nurikabe game, or null for invalid board data or progress. |
decodeRegions | function | Regions row-major, one letter each, or null for a string that is not that. |
decodeRegionsGame | function | Read a native saved Regions game, or null for invalid board data or progress. |
decodeRipple | function | Read a native saved Ripple game, or null for invalid board data or progress. |
decodeRun | function | The entries a run's code says, or null for a code that is not a run of this side. |
decodeShikaku | function | Read a native saved Shikaku game, or null for invalid board data or progress. |
decodeSteps | function | The grids a step log holds, each cells characters long, or null for a log that does not read as one. |
decodeTowers | function | The cells and clues a code says, or null for a string that is not a Towers puzzle of this size. |
decodeYajilin | function | Read a native saved Yajilin game, or null for invalid board data or progress. |
drawAkari | function | Draws the public clues and current bulbs as SVG. |
drawCrossSums | function | Render the CrossSums board and supplied current state as native SVG text. |
drawHeyawake | function | Render the Heyawake board and supplied current state as native SVG text. |
drawJuosan | function | Draws a public Juosan board as an SVG string. |
drawLoop | function | Draws public clues and selected loop edges as an SVG board. |
drawRegions | function | Render the Regions board and supplied current state as native SVG text. |
drawRipple | function | Render the Ripple board and supplied current state as native SVG text. |
edgeVertices | function | Read the two vertex indices at the ends of a native Loop edge. |
EMPTY_CELL | constant | A GRID OF NUMBERS AS A STRING: for an address, a POST body, and a kept run. |
encodeAkari | function | Encodes only public clues and player placements. |
encodeCells | function | [0, 3, 0, 1] → ".3.1". |
encodeCrossSums | function | Encode the CrossSums board and current game as native resumable text. |
encodeHeyawake | function | Encode the Heyawake board and current game as native resumable text. |
encodeHitori | function | Versioned public clue and mark data; the generated answer is not saved. |
encodeJigsaw | function | A Jigsaw's givens: the cells, then the regions, one letter a cell. |
encodeJuosan | function | Serializes public clues, placements, and assisted status. |
encodeKiller | function | A Sum Cages puzzle's givens: the cells, then which cage each cell is in, then each cage's sum. |
encodeLoop | function | Encode the Loop board and current game as native resumable text. |
encodeMasyu | function | Encode the Masyu board and current game as native resumable text. |
encodeMoreOrLess | function | Encode grid numbers and less-than relations as the native Futoshiki givens code. |
encodeNotes | function | Pencil 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. |
encodeNurikabe | function | Encode the Nurikabe board and current game as native resumable text. |
encodeRegions | function | The region of every cell as a letter, a for the first region and so on: one character a cell. |
encodeRegionsGame | function | Encode the Regions board and current game as native resumable text. |
encodeRipple | function | Encode the Ripple board and current game as native resumable text. |
encodeRun | function | The entries of a run as its code. |
encodeShikaku | function | Versioned public puzzle and placement data, with no hidden answer. |
encodeSteps | function | THE STEPS OF A PUZZLE, written down so a scrubber has them when the puzzle is picked up again. |
encodeTowers | function | Encode grid numbers and four sides of visibility clues as native Skyscrapers givens. |
encodeYajilin | function | Encode the Yajilin 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. |
enterNumber | function | Write a number into a cell (0 empties it). |
entryRegions | function | Group connected cells carrying the same entry into candidate regions. |
finishedCrossSums | function | Whether this CrossSums game satisfies its complete native rules. |
freshKazuSeed | function | A new seed, from Math.random or the stream given: anywhere in the range. |
gameConflicts | function | The cells that break a rule now (conflictsOf). |
generateAkari | function | Makes a seeded board and proves it has one answer. |
generateCrossSums | function | Makes a seeded board of size squares a side (counting the row and column of totals) and proves it has one answer. |
generateDiagonal | function | A Diagonal Sudoku (Sudoku X): Sudoku with the two long diagonals as groups too. |
generateHeyawake | function | Generate a seeded Heyawake puzzle with a verified unique answer; unsupported inputs or exhausted attempts throw. |
generateHitori | function | Makes a seeded puzzle and proves its answer is the only one. |
generateJigsaw | function | A Jigsaw Sudoku of this side, level and seed: 5, 6, 7 or 9. |
generateJuosan | function | Makes an original small training puzzle and returns it only after uniqueness is proved. |
generateKazu | function | A puzzle of any of the six, from a seed: the one door. |
generateLoop | function | Makes a seeded puzzle and proves it has one answer. |
generateMasyu | function | Seeded original loop layouts; every output is accepted only after a completed uniqueness proof. |
generateMoreOrLess | function | A Futoshiki (More or Less) of this side, level and seed: 4, 5, 6 or 7. |
generateNumberPlace | function | A Sudoku (Number Place) of this side, level and seed: 4, 6, 9, 16 or 25. |
generateNurikabe | function | Seeded symmetries of original 5×5 layouts are returned only after the solver proves uniqueness. |
generateRegions | function | Makes a seeded puzzle and proves its answer is the only one. |
generateRipple | function | Builds a seeded block-room family and accepts it only after a bounded uniqueness proof. |
generateShikaku | function | Seeded rectangles packed into the board, one number each, with an independently counted, unique answer. |
generateShikakuChallenge | function | Generate a seeded Shikaku puzzle with a verified unique answer; unsupported inputs or exhausted attempts throw. |
generateSumCages | function | A Killer Sudoku (Sum Cages) of this side, level and seed: 6 or 9. |
generateTowers | function | A Skyscrapers (Towers) puzzle of this side, level and seed: 4, 5, 6 or 7. |
generateYajilin | function | Seeded original 5×5 families, accepted only after a completed uniqueness proof. |
HEYAWAKE_GENERATOR_MOST_CELLS | constant | The maximum number of cells accepted by the Heyawake generator. |
HEYAWAKE_LEVELS | constant | The native Heyawake generation difficulty tiers. |
HEYAWAKE_MOST_ATTEMPTS | constant | The native Heyawake generation-attempt limit. |
HEYAWAKE_MOST_NODES | constant | The native Heyawake search-node budget. |
HEYAWAKE_MOST_SIDE | constant | The maximum supported Heyawake board dimension. |
HEYAWAKE_PLAY_STYLE | constant | Scoped native Heyawake board and player CSS. |
HeyawakeAppearance | type | Language, material and marks for a native Heyawake board. |
HeyawakeBoard | type | Heyawake dimensions and printed clues in their native row-major representation. |
heyawakeCells | function | Read room cells, or null for a room outside this board. |
HeyawakeCheck | type | The Heyawake completion result and cells that violate its native rules. |
HeyawakeDrawOptions | type | Current Heyawake marks or entries, selection, errors and native SVG appearance choices. |
heyawakeFinished | function | Whether this Heyawake game satisfies its complete native rules. |
HeyawakeGame | type | The immutable Heyawake board, current entries or marks, undo history and assistance state. |
HeyawakeLevel | type | A native difficulty tier for generated Heyawake puzzles. |
HeyawakeMount | type | The mounted Heyawake game and progress, native controls and cleanup handle. |
HeyawakeMountOptions | type | The initial Heyawake board, native progress, appearance and host event callbacks. |
heyawakeNeighbours | function | Read orthogonally adjacent Heyawake cells. |
HeyawakePuzzle | type | A seeded Heyawake board with its verified solution and native difficulty tier. |
HeyawakeRoom | type | A rectangular room and its optional required black-cell count. |
HeyawakeSolve | type | A bounded Heyawake solve result: answer count, first solution, node work and whether the search completed. |
heyawakeWords | function | Read the native English or Japanese Heyawake labels. |
hintAkari | function | Returns a missing bulb, or an extra bulb to remove, only after uniqueness is proved. |
hintCrossSums | function | Find a native CrossSums hint, or null when no actionable hint is available. |
hintHeyawake | function | Find a native Heyawake hint, or null when no actionable hint is available. |
hintHitori | function | Gives one next shade in the unique minimal solution, if uniqueness was proved. |
hintJuosan | function | Returns one next mark only when the public clues prove a unique answer. |
hintKazu | function | The next cell a person could fill in, and why (see KazuHint). |
hintLoop | function | Find a native Loop hint, or null when no actionable hint is available. |
hintMasyu | function | Find a native Masyu hint, or null when no actionable hint is available. |
hintNurikabe | function | Find a native Nurikabe hint, or null when no actionable hint is available. |
hintRegions | function | Find a native Regions hint, or null when no actionable hint is available. |
hintRipple | function | Offers a cell only when the current public entries leave one proved completion. |
hintShikaku | function | A rectangle is offered only when the remaining partition has one proved answer. |
hintYajilin | function | Find a native Yajilin hint, or null when no actionable hint is available. |
HITORI_LEAST_SIDE | constant | The minimum supported Hitori board dimension. |
HITORI_LEVELS | constant | How hard a puzzle is made, by what a person must do to solve it; see rateHitori. |
HITORI_MAX_NODES | constant | The native Hitori search-node budget. |
HITORI_MOST_ATTEMPTS | constant | The native Hitori generation-attempt limit. |
HITORI_MOST_SIDE | constant | The maximum supported Hitori board dimension. |
HITORI_SIZES | constant | The sides on offer; any side from 4 to HITORI_MOST_SIDE is a board isHitoriBoard takes. |
HitoriBoard | type | Hitori dimensions and printed clues in their native row-major representation. |
HitoriGame | type | The immutable Hitori board, current entries or marks, undo history and assistance state. |
HitoriLevel | type | A native difficulty tier for generated Hitori puzzles. |
hitoriNeighbors | function | Read orthogonally adjacent cells on a square Hitori board. |
HitoriPuzzle | type | A seeded Hitori board with its verified solution and native difficulty tier. |
HitoriRating | type | How hard a board is, measured by solving it. |
HitoriSolve | type | A bounded Hitori solve result: answer count, first solution, node work and whether the search completed. |
isAkariBoard | function | Validates dimensions and the three public square kinds. |
isCrossSumsBoard | function | Whether the value has valid native CrossSums dimensions, clues and data. |
isHeyawakeBoard | function | Whether the value has valid native Heyawake dimensions, clues and data. |
isHitoriBoard | function | Whether the value has valid native Hitori dimensions, clues and data. |
isJuosanBoard | function | Whether territories partition a bounded board and each territory is connected. |
isKazuGivens | function | Whether a puzzle's givens are a well-formed puzzle of that kind and side at all (a Jigsaw's regions sound, every code readable). |
isKazuKind | function | Whether a value is one of the six keys. |
isKazuLevel | function | Whether a value is one of the three levels. |
isKazuSeed | function | Whether a value is a seed this package takes: a whole number from 1 to KAZU_SEED_MOST. |
isKazuSize | function | Whether this puzzle can be made at this side. |
isLoopBoard | function | Whether the value has valid native Loop dimensions, clues and data. |
isMasyuBoard | function | Whether the value has valid native Masyu dimensions, clues and data. |
isNurikabeBoard | function | Whether the value has valid native Nurikabe dimensions, clues and data. |
isPrinted | function | Whether a cell was printed with its number: it never changes. |
isRegionsBoard | function | Whether the value has valid native Regions dimensions, clues and data. |
isRippleBoard | function | Whether the value has valid native Ripple dimensions, clues and data. |
isShikakuBoard | function | Whether dimensions and area clues describe a possible partition. |
isSolved | function | Whether 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. |
isYajilinBoard | function | Whether the value has valid native Yajilin dimensions, clues and data. |
JUOSAN_LEVELS | constant | The native Juosan generation difficulty tiers. |
JUOSAN_MOST_ATTEMPTS | constant | The native Juosan generation-attempt limit. |
JUOSAN_MOST_NODES | constant | The native Juosan search-node budget. |
JUOSAN_MOST_SIDE | constant | The maximum supported Juosan board dimension. |
JUOSAN_PLAY_STYLE | constant | Scoped native Juosan board and player CSS. |
JUOSAN_STRINGS | constant | Native English and Japanese labels and announcements for Juosan. |
JuosanBoard | type | Juosan dimensions and printed clues in their native row-major representation. |
JuosanCheck | type | The Juosan completion result and cells that violate its native rules. |
JuosanDrawOptions | type | Current Juosan marks or entries, selection, errors and native SVG appearance choices. |
juosanFinished | function | Whether every cell is filled and the independent checker accepts the board. |
JuosanGame | type | The immutable Juosan board, current entries or marks, undo history and assistance state. |
JuosanLanguage | type | The native English or Japanese display language for Juosan. |
JuosanLevel | type | A native difficulty tier for generated Juosan puzzles. |
JuosanMark | type | A blank, horizontal or vertical mark in a Juosan cell. |
JuosanMaterial | type | A supported material of the native Juosan board. |
JuosanMount | type | The mounted Juosan game and progress, native controls and cleanup handle. |
JuosanMountOptions | type | The initial Juosan board, native progress, appearance and host event callbacks. |
JuosanPieces | type | A supported native Juosan mark or piece appearance. |
JuosanPuzzle | type | A seeded Juosan board with its verified solution and native difficulty tier. |
JuosanSolve | type | A bounded Juosan solve result: answer count, first solution, node work and whether the search completed. |
JuosanTerritory | type | A territory is a list of zero-based cell indexes and an absolute orientation difference. |
juosanTerritoryAt | function | Returns the index of the territory containing a cell, or -1 when absent. |
KAZU_BOXES | constant | A 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_KIND | constant | The names itsutsu.com gave the six in its code, to the keys here: what a site's stored kind becomes. |
KAZU_KINDS | constant | THE SIX PUZZLES, and what each offers: the keys, the sizes and the levels. |
KAZU_LEVELS | constant | How hard a puzzle is made: what the solver needed. |
KAZU_SEED_MOST | constant | The most a seed can be: a whole number from 1 to 2³¹ − 1, so it travels in an address as a plain integer. |
KAZU_SPECS | constant | Supported sizes, native default size and givens-code limits for each number-grid kind. |
KAZU_STEPS_KEPT | constant | How many grids a step log keeps: the newest, so a long puzzle's log has a ceiling. |
KazuCheck | type | The verdict on a submitted answer: { ok: true }, or { ok: false, reason } in the words the site has always used. |
kazuClockText | function | A time taken, as a clock shows it: m:ss, and h:mm:ss past an hour. |
KazuGame | type | A PUZZLE IN PLAY, as pure functions: what has been written, the pencil marks, and how to take a step back. |
KazuGameOptions | type | Optional entries and pencil-note masks to restore when creating a native number-grid game. |
KazuGivens | type | WHAT 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. |
kazuGuessDepth | function | How 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. |
kazuHash | function | A short fingerprint of a puzzle's givens (FNV-1a, eight hex characters): the same puzzle, however it was kept, has the same one. |
KazuHint | type | A HINT: the next cell a person could fill in by looking, and why. |
KazuKind | type | One of the six native number-grid puzzle kinds. |
KazuLevel | type | One of the native easy, medium or hard generation tiers. |
kazuProgress | function | How far along it is: cells with a number (printed or written) out of all of them. |
KazuPuzzle | type | One puzzle, made from a seed or read back from its codes. |
KazuSpec | type | What one puzzle offers. |
layoutOfGivens | function | The 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. |
lineFrom | function | The 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_LEVELS | constant | How hard a puzzle is made, by what a person must do to solve it; see rateLoop. |
LOOP_MOST_ATTEMPTS | constant | The native Loop generation-attempt limit. |
LOOP_MOST_NODES | constant | The native Loop search-node budget. |
LOOP_MOST_SIDE | constant | The maximum supported Loop board dimension. |
LOOP_SIZES | constant | The sides on offer for a square board; any side from 2 to LOOP_MOST_SIDE can be made. |
LoopBoard | type | Loop dimensions and printed clues in their native row-major representation. |
loopCellEdges | function | Read the four edges around a cell, or null for a cell outside the board. |
LoopCheck | type | The Loop completion result and cells that violate its native rules. |
LoopDrawOptions | type | Current Loop marks or entries, selection, errors and native SVG appearance choices. |
loopEdgeCount | function | An edge index is horizontal row-major first, then vertical row-major. |
loopFinished | function | Whether this Loop game satisfies its complete native rules. |
LoopGame | type | The immutable Loop board, current entries or marks, undo history and assistance state. |
loopHorizontalCount | function | Count horizontal edges in the Loop board’s native edge numbering. |
LoopLanguage | type | The native English or Japanese display language for Loop. |
LoopLevel | type | A native difficulty tier for generated Loop puzzles. |
LoopMaterial | type | A supported material of the native Loop board. |
LoopMount | type | The mounted Loop game and progress, native controls and cleanup handle. |
LoopMountOptions | type | The initial Loop board, native progress, appearance and host event callbacks. |
LoopProgress | type | The Loop constraint status of a partial board. |
LoopPuzzle | type | A seeded Loop board with its verified solution and native difficulty tier. |
LoopRating | type | How hard a board is, measured by solving it. |
LoopSolve | type | A bounded Loop solve result: answer count, first solution, node work and whether the search completed. |
loopVertexEdges | function | Read edges meeting a native Loop vertex. |
Mark | type | A mark: the cell at less holds a smaller number than the cell at more. |
markNurikabeSea | function | Apply the requested native Nurikabe entry or mark to a new immutable game; invalid or fixed targets stay unchanged. |
MASYU_NODE_BUDGET | constant | The native Masyu search-node budget. |
MASYU_SIZES | constant | The supported Masyu board sizes. |
MasyuBoard | type | Masyu dimensions and printed clues in their native row-major representation. |
masyuCellCount | function | Count cells in a Masyu board. |
MasyuCheck | type | The Masyu completion result and cells that violate its native rules. |
MasyuDrawOptions | type | Current Masyu marks or entries, selection, errors and native SVG appearance choices. |
masyuEdgeCount | function | Count native Masyu edges. |
masyuFinished | function | Whether this Masyu game satisfies its complete native rules. |
MasyuGame | type | The immutable Masyu board, current entries or marks, undo history and assistance state. |
MasyuMount | type | The mounted Masyu game and progress, native controls and cleanup handle. |
MasyuMountOptions | type | The initial Masyu board, native progress, appearance and host event callbacks. |
masyuNeighbors | function | Read adjacent Masyu cells with the joining edge and direction. |
MasyuPuzzle | type | A seeded Masyu board with its verified solution. |
MasyuSolve | type | A bounded Masyu solve result: answer count, first solution, node work and whether the search completed. |
mountAkari | function | Mounts the player in a host element; call destroy when the host is removed. |
mountCrossSums | function | Mount the native CrossSums player in a host element and return its cleanup and control handle. |
mountHeyawake | function | Mount the native Heyawake player in a host element and return its cleanup and control handle. |
mountJuosan | function | Mounts a touch, mouse, and keyboard player into an existing page element. |
mountLoop | function | Mounts an accessible dot-and-edge loop player in the given host element. |
mountRipple | function | Mount the native Ripple player in a host element and return its cleanup and control handle. |
neighbours | function | The cells sharing an edge with index. |
newAkari | function | Starts a game with only its public board data. |
newCrossSums | function | Create the initial immutable CrossSums game from a valid board. |
newHeyawake | function | Create the initial immutable Heyawake game from a valid board. |
newHitori | function | Create the initial immutable Hitori game from a valid board. |
newJuosan | function | Starts a game with a copy of its public board and no generated answer. |
newKazuGame | function | A game of a puzzle, or null for givens that are not a puzzle of that kind and side. |
newLoop | function | Create the initial immutable Loop game from a valid board. |
newMasyu | function | Create the initial immutable Masyu game from a valid board. |
newNurikabe | function | Create the initial immutable Nurikabe game from a valid board. |
newRegions | function | Create the initial immutable Regions game from a valid board. |
newRipple | function | Create the initial immutable Ripple game from a valid board. |
newShikaku | function | Begin with a copy of just the public clues; a generated answer is never kept in play. |
newYajilin | function | Create the initial immutable Yajilin game from a valid board. |
NO_MARK | constant | The native code character for an absent Futoshiki relation. |
noClues | function | Create empty visibility clues on all four sides of a square grid. |
notesOf | function | Every value of a pencil-mark mask, smallest first. |
numberCounts | function | The 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_NODES | constant | The native Nurikabe search-node budget. |
NURIKABE_SIZES | constant | The supported Nurikabe board sizes. |
NurikabeBoard | type | Nurikabe dimensions and printed clues in their native row-major representation. |
NurikabeGame | type | The immutable Nurikabe board, current entries or marks, undo history and assistance state. |
nurikabeNeighbors | function | Read orthogonally adjacent cells on a square Nurikabe board. |
NurikabePuzzle | type | A seeded Nurikabe board with its verified solution. |
NurikabeSolve | type | A bounded Nurikabe solve result: answer count, first solution, node work and whether the search completed. |
placeShikaku | function | Place a rectangle, replacing any it touches. |
progressAkari | function | Reports immediate contradictions while allowing required clues to remain unsatisfied during play. |
progressCrossSums | function | Allows unfinished runs while flagging duplicate digits and impossible remaining totals. |
progressLoop | function | Reports overfilled clues and branched vertices during play without requiring a finished loop. |
progressRipple | function | Partial progress check; missing entries are allowed, but impossible room/ripple pairs are flagged. |
Random | type | A number in [0, 1), like Math.random, from a stream a seed fixes. |
rateAkari | function | Rates 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. |
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. |
rateHitori | function | Rates a board with one answer by solving it: with the plain rules, with the whites-stay-together rule, then by supposing. |
rateLoop | function | Rates a board with one answer by solving it as a person would: with the rules, then by supposing one edge at a time. |
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. |
rateShikaku | function | Rates a board with one answer by solving it with the first rule, with the first two, with all three, then by supposing. |
readGivens | function | The givens of a puzzle, or null for a code that is not one of that kind and side. |
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. |
regionsAreSound | function | Whether region divides a size×size grid into size regions of size cells each, every one of them joined edge to edge. |
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. |
removeShikaku | function | Remove the rectangle containing a cell. |
restartCrossSums | function | Return the CrossSums game reset to its initial entries or marks. |
restartHeyawake | function | Return the Heyawake game reset to its initial entries or marks. |
restartHitori | function | Return the Hitori game reset to its initial entries or marks. |
restartJuosan | function | Clears the board while retaining whether the player used a hint. |
restartKazu | function | Start again: every entry and pencil mark gone, and nothing to undo. |
restartMasyu | function | Return the Masyu game reset to its initial entries or marks. |
restartNurikabe | function | Return the Nurikabe game reset to its initial entries or marks. |
restartRegions | function | Return the Regions game reset to its initial entries or marks. |
restartYajilin | function | Return the Yajilin game reset to its initial entries or marks. |
RIPPLE_MAX_ATTEMPTS | constant | The native Ripple generation-attempt limit. |
RIPPLE_MAX_NODES | constant | The native Ripple search-node budget. |
RIPPLE_MAX_SIDE | constant | The maximum supported Ripple board dimension. |
RIPPLE_MIN_SIDE | constant | The minimum supported Ripple board dimension. |
RIPPLE_PLAY_STYLE | constant | Scoped native Ripple board and player CSS. |
RIPPLE_STRINGS | constant | Native English and Japanese labels and announcements for Ripple. |
RippleBoard | type | Ripple dimensions and printed clues in their native row-major representation. |
RippleCheck | type | The Ripple completion result and cells that violate its native rules. |
RippleDrawOptions | type | Current Ripple marks or entries, selection, errors and native SVG appearance choices. |
rippleFinished | function | Whether this Ripple game satisfies its complete native rules. |
RippleGame | type | The immutable Ripple board, current entries or marks, undo history and assistance state. |
RippleLanguage | type | The native English or Japanese display language for Ripple. |
RippleMaterial | type | A supported material of the native Ripple board. |
RippleMount | type | The mounted Ripple game and progress, native controls and cleanup handle. |
RippleMountOptions | type | The initial Ripple board, native progress, appearance and host event callbacks. |
RipplePieces | type | A supported native Ripple mark or piece appearance. |
RipplePuzzle | type | A seeded Ripple board with its verified solution. |
rippleRoomSizes | function | Read the size of each room in a Ripple Effect board. |
RippleSolve | type | A bounded Ripple solve result: answer count, first solution, node work and whether the search completed. |
roomForCell | function | Read the containing room index for each Heyawake cell. |
seededRandom | function | A stream of numbers in [0, 1) fixed by a seed. |
Segment | type | A line segment in cell units: where one part of a cage's dashed outline runs. |
setHeyawakeCell | function | Apply the requested native Heyawake entry or mark to a new immutable game; invalid or fixed targets stay unchanged. |
setJuosanMark | function | Writes a mark and records the previous state; invalid or unchanged moves are ignored. |
setRegionsCell | function | Apply the requested native Regions entry or mark to a new immutable game; invalid or fixed targets stay unchanged. |
setRippleValue | function | Apply the requested native Ripple entry or mark to a new immutable game; invalid or fixed targets stay unchanged. |
shadeHitori | function | Apply the requested native Hitori entry or mark to a new immutable game; invalid or fixed targets stay unchanged. |
SHIKAKU_CHALLENGE_PACKS | constant | Three short, named challenge routes using the regular seeded unique-puzzle generator. |
SHIKAKU_LEVELS | constant | How hard a puzzle is made, by what a person must do to solve it; see rateShikaku. |
SHIKAKU_MOST_ATTEMPTS | constant | The native Shikaku generation-attempt limit. |
SHIKAKU_MOST_NODES | constant | The native Shikaku search-node budget. |
SHIKAKU_MOST_SIDE | constant | Bounds keep custom boards and searches finite. |
SHIKAKU_SIZES | constant | The sides on offer for a square board; any side from 2 to SHIKAKU_MOST_SIDE can be made. |
ShikakuBoard | type | One area clue per rectangle; zero is an unnumbered cell. |
shikakuCandidates | function | All legal rectangles for a numbered cell, in a stable order. |
shikakuCells | function | Cells of a bounded rectangle, or null for invalid coordinates. |
ShikakuChallenge | type | The named route, board shape, difficulty and seed of one Shikaku challenge. |
ShikakuChallengePuzzle | type | A named Shikaku challenge paired with its generated unique puzzle. |
ShikakuCheck | type | The Shikaku completion result and cells that violate its native rules. |
shikakuFinished | function | Whether this Shikaku game satisfies its complete native rules. |
ShikakuGame | type | The immutable Shikaku board, current entries or marks, undo history and assistance state. |
ShikakuLevel | type | A native difficulty tier for generated Shikaku puzzles. |
ShikakuPackKey | type | One of the square, wide or tall native Shikaku challenge routes. |
ShikakuPuzzle | type | A seeded Shikaku board with its verified solution and native difficulty tier. |
ShikakuRating | type | How hard a board is, measured by solving it. |
ShikakuRectangle | type | A rectangle uses zero-based column and row coordinates. |
ShikakuSolve | type | A bounded Shikaku solve result: answer count, first solution, node work and whether the search completed. |
shuffled | function | A copy of the list in a random order (Fisher–Yates, from the end); the list given is left alone. |
solveAkari | function | Bounded constraint search over the rules in akariLogic.ts; a stopped proof is always marked incomplete. |
solveCrossSums | function | Bounded exact counter over across and down runs; an interrupted search never proves uniqueness. |
solveHeyawake | function | Search for Heyawake answers up to the solution and node limits; completion distinguishes a proved result from exhausted work. |
solveHitori | function | Counts distinct minimal shade patterns: an answer shades only squares that settle a duplicate, so extra shades are never a second answer. |
solveJuosan | function | Counts labeled solutions up to a limit; complete distinguishes exhaustion from cutoff. |
solveKazu | function | The 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). |
solveLoop | function | Counts loop solutions with the pruning in loopLogic.ts under explicit work bounds. |
solveMasyu | function | Counts distinct single loops with local pearl rules; budget stops never claim a proof. |
solveNurikabe | function | Counts valid island placements and checks the remaining cells as the sea under a finite budget. |
solveRegions | function | Counts completed partitions. |
solveRipple | function | Counts rule-valid fillings within an explicit node budget. |
solveShikaku | function | Exact cover over squares. |
solveYajilin | function | Counts public shade patterns whose remaining cells form the single required loop. |
stepEntry | function | The 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. |
symbolOf | function | How a value is written, in a code and on a cell: 1–9, then A–P. |
toggleAkari | function | Toggles a bulb on a white square and keeps one prior turn for undo. |
toggleLoop | function | Apply the requested native Loop entry or mark to a new immutable game; invalid or fixed targets stay unchanged. |
toggleMasyuEdge | function | Apply the requested native Masyu entry or mark to a new immutable game; invalid or fixed targets stay unchanged. |
toggleNote | function | Turn the pencil mark value on or off in a cell. |
toggleRippleNote | function | Apply the requested native Ripple entry or mark to a new immutable game; invalid or fixed targets stay unchanged. |
toggleYajilinEdge | function | Apply the requested native Yajilin entry or mark to a new immutable game; invalid or fixed targets stay unchanged. |
toggleYajilinShade | function | Apply the requested native Yajilin entry or mark to a new immutable game; invalid or fixed targets stay unchanged. |
TOWER_SIDES | constant | Towers (Skyscrapers) as a string: the cells, then the clues around the edge. |
TowerClues | type | Each side's clues, in reading order along it; 0 where there is none. |
TowerSide | type | The top, bottom, left or right side of Skyscrapers visibility clues. |
towersSeen | function | How many towers show looking along heights from its first end: each one taller than every one before it. |
undoAkari | function | Restores the last bulb placement. |
undoCrossSums | function | Return the CrossSums game with its previous marks or entries restored, or unchanged when there is no undo history. |
undoHeyawake | function | Return the Heyawake game with its previous marks or entries restored, or unchanged when there is no undo history. |
undoHitori | function | Return the Hitori game with its previous marks or entries restored, or unchanged when there is no undo history. |
undoJuosan | function | Restores the preceding mark state, if one exists. |
undoKazu | function | Take back the last change. |
undoLoop | function | Return the Loop game with its previous marks or entries restored, or unchanged when there is no undo history. |
undoMasyu | function | Return the Masyu game with its previous marks or entries restored, or unchanged when there is no undo history. |
undoNurikabe | function | Return the Nurikabe game with its previous marks or entries restored, or unchanged when there is no undo history. |
undoRegions | function | Return the Regions game with its previous marks or entries restored, or unchanged when there is no undo history. |
undoRipple | function | Return the Ripple game with its previous marks or entries restored, or unchanged when there is no undo history. |
undoShikaku | function | Return the Shikaku game with its previous marks or entries restored, or unchanged when there is no undo history. |
undoYajilin | function | Return the Yajilin game with its previous marks or entries restored, or unchanged when there is no undo history. |
valueOfSymbol | function | The value a symbol names, or 0 for one that is not 1–9 or A–P (either case). |
valuesOf | function | The whole grid as it stands: the printed numbers, and the player's where nothing is printed. |
VERSION | constant | The package's version. |
YAJILIN_NODE_BUDGET | constant | The native Yajilin search-node budget. |
YAJILIN_SIZES | constant | The supported Yajilin board sizes. |
YajilinBoard | type | Yajilin dimensions and printed clues in their native row-major representation. |
YajilinCheck | type | The Yajilin completion result and cells that violate its native rules. |
YajilinClue | type | An arrow direction and the required number of shaded cells in its ray. |
YajilinDirection | type | The direction an arrow clue looks along a row or column. |
YajilinDrawOptions | type | Current Yajilin marks or entries, selection, errors and native SVG appearance choices. |
yajilinEdgeCount | function | Count native Yajilin edges. |
YajilinGame | type | The immutable Yajilin board, current entries or marks, undo history and assistance state. |
YajilinMount | type | The mounted Yajilin game and progress, native controls and cleanup handle. |
YajilinMountOptions | type | The initial Yajilin board, native progress, appearance and host event callbacks. |
yajilinNeighbors | function | Read adjacent Yajilin cells and the joining edge. |
YajilinPuzzle | type | A seeded Yajilin board with its verified solution. |
yajilinRay | function | Read cells in the arrow’s indicated direction, excluding its own clue cell. |
YajilinSolution | type | The solved Yajilin shading and loop edges. |
YajilinSolve | type | A bounded Yajilin solve result: answer count, first solution, node work and whether the search completed. |