本文へ移動

Kazu数

検証済みの数独や論理パズルを作り、標準の規則とヒントを読み、盤を描いたり埋め込んだりできます。

「数」は数字を表す言葉です。 名前について(英語)

目次

リファレンス

縦横の規則

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

最小化と gzip 圧縮をしたサイズは 6.1 kB(読み込むものをすべて含み、esbuild で計測)

リファレンスの説明と例は英語です。見出しと目次は日本語です。

エクスポート

名前種類概要
checkJuosan関数Checks public rules directly, independently of the solver and stored answer.
decodeJuosan関数Reads a bounded public save; malformed or incompatible data returns null.
drawJuosan関数Draws a public Juosan board as an SVG string.
encodeJuosan関数Serializes public clues, placements, and assisted status.
generateJuosan関数Makes an original small training puzzle and returns it only after uniqueness is proved.
hintJuosan関数Returns one next mark only when the public clues prove a unique answer.
isJuosanBoard関数Whether territories partition a bounded board and each territory is connected.
JUOSAN_LEVELS定数The native Juosan generation difficulty tiers.
JUOSAN_MOST_ATTEMPTS定数The native Juosan generation-attempt limit.
JUOSAN_MOST_NODES定数The native Juosan search-node budget.
JUOSAN_MOST_SIDE定数The maximum supported Juosan board dimension.
JUOSAN_PLAY_STYLE定数Scoped native Juosan board and player CSS.
JUOSAN_STRINGS定数Native English and Japanese labels and announcements for Juosan.
JuosanBoard型Juosan dimensions and printed clues in their native row-major representation.
JuosanCheck型The Juosan completion result and cells that violate its native rules.
JuosanDrawOptions型Current Juosan marks or entries, selection, errors and native SVG appearance choices.
juosanFinished関数Whether every cell is filled and the independent checker accepts the board.
JuosanGame型The immutable Juosan board, current entries or marks, undo history and assistance state.
JuosanLanguage型The native English or Japanese display language for Juosan.
JuosanLevel型A native difficulty tier for generated Juosan puzzles.
JuosanMark型A blank, horizontal or vertical mark in a Juosan cell.
JuosanMaterial型A supported material of the native Juosan board.
JuosanMount型The mounted Juosan game and progress, native controls and cleanup handle.
JuosanMountOptions型The initial Juosan board, native progress, appearance and host event callbacks.
JuosanPieces型A supported native Juosan mark or piece appearance.
JuosanPuzzle型A seeded Juosan board with its verified solution and native difficulty tier.
JuosanSolve型A bounded Juosan solve result: answer count, first solution, node work and whether the search completed.
JuosanTerritory型A territory is a list of zero-based cell indexes and an absolute orientation difference.
juosanTerritoryAt関数Returns the index of the territory containing a cell, or -1 when absent.
mountJuosan関数Mounts a touch, mouse, and keyboard player into an existing page element.
newJuosan関数Starts a game with a copy of its public board and no generated answer.
restartJuosan関数Clears the board while retaining whether the player used a hint.
setJuosanMark関数Writes a mark and records the previous state; invalid or unchanged moves are ignored.
solveJuosan関数Counts labeled solutions up to a limit; complete distinguishes exhaustion from cutoff.
undoJuosan関数Restores the preceding mark state, if one exists.

ソースを見るGitHub で編集@johnmorrisdotca/kazu 2.1.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。