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

Masyu rules

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

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

Exports

NameKindWhat it is
checkMasyufunctionValidate a Masyu answer against the printed clues and complete native rules.
decodeMasyufunctionRead a native saved Masyu game, or null for invalid board data or progress.
encodeMasyufunctionEncode the Masyu board and current game as native resumable text.
generateMasyufunctionSeeded original loop layouts; every output is accepted only after a completed uniqueness proof.
hintMasyufunctionFind a native Masyu hint, or null when no actionable hint is available.
isMasyuBoardfunctionWhether the value has valid native Masyu dimensions, clues and data.
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.
newMasyufunctionCreate the initial immutable Masyu game from a valid board.
restartMasyufunctionReturn the Masyu game reset to its initial entries or marks.
solveMasyufunctionCounts distinct single loops with local pearl rules; budget stops never claim a proof.
toggleMasyuEdgefunctionApply the requested native Masyu entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
undoMasyufunctionReturn the Masyu game with its previous marks or entries restored, or unchanged when there is no undo history.

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