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

Juosan rules

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

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

Exports

NameKindWhat it is
checkJuosanfunctionChecks public rules directly, independently of the solver and stored answer.
decodeJuosanfunctionReads a bounded public save; malformed or incompatible data returns null.
drawJuosanfunctionDraws a public Juosan board as an SVG string.
encodeJuosanfunctionSerializes public clues, placements, and assisted status.
generateJuosanfunctionMakes an original small training puzzle and returns it only after uniqueness is proved.
hintJuosanfunctionReturns one next mark only when the public clues prove a unique answer.
isJuosanBoardfunctionWhether territories partition a bounded board and each territory is connected.
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.
mountJuosanfunctionMounts a touch, mouse, and keyboard player into an existing page element.
newJuosanfunctionStarts a game with a copy of its public board and no generated answer.
restartJuosanfunctionClears the board while retaining whether the player used a hint.
setJuosanMarkfunctionWrites a mark and records the previous state; invalid or unchanged moves are ignored.
solveJuosanfunctionCounts labeled solutions up to a limit; complete distinguishes exhaustion from cutoff.
undoJuosanfunctionRestores the preceding mark state, if one exists.

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