Reference
Masyu rules
import { … } from "@johnmorrisdotca/kazu/masyu";
2.6 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
checkMasyu | function | Validate a Masyu answer against the printed clues and complete native rules. |
decodeMasyu | function | Read a native saved Masyu game, or null for invalid board data or progress. |
encodeMasyu | function | Encode the Masyu board and current game as native resumable text. |
generateMasyu | function | Seeded original loop layouts; every output is accepted only after a completed uniqueness proof. |
hintMasyu | function | Find a native Masyu hint, or null when no actionable hint is available. |
isMasyuBoard | function | Whether the value has valid native Masyu dimensions, clues and data. |
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. |
newMasyu | function | Create the initial immutable Masyu game from a valid board. |
restartMasyu | function | Return the Masyu game reset to its initial entries or marks. |
solveMasyu | function | Counts distinct single loops with local pearl rules; budget stops never claim a proof. |
toggleMasyuEdge | function | Apply the requested native Masyu entry or mark to a new immutable game; invalid or fixed targets stay unchanged. |
undoMasyu | function | Return the Masyu game with its previous marks or entries restored, or unchanged when there is no undo history. |