Reference
Juosan rules
import { … } from "@johnmorrisdotca/kazu/juosan";
6.1 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
checkJuosan | function | Checks public rules directly, independently of the solver and stored answer. |
decodeJuosan | function | Reads a bounded public save; malformed or incompatible data returns null. |
drawJuosan | function | Draws a public Juosan board as an SVG string. |
encodeJuosan | function | Serializes public clues, placements, and assisted status. |
generateJuosan | function | Makes an original small training puzzle and returns it only after uniqueness is proved. |
hintJuosan | function | Returns one next mark only when the public clues prove a unique answer. |
isJuosanBoard | function | Whether territories partition a bounded board and each territory is connected. |
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. |
mountJuosan | function | Mounts a touch, mouse, and keyboard player into an existing page element. |
newJuosan | function | Starts a game with a copy of its public board and no generated answer. |
restartJuosan | function | Clears the board while retaining whether the player used a hint. |
setJuosanMark | function | Writes a mark and records the previous state; invalid or unchanged moves are ignored. |
solveJuosan | function | Counts labeled solutions up to a limit; complete distinguishes exhaustion from cutoff. |
undoJuosan | function | Restores the preceding mark state, if one exists. |