本文へ移動

Kazu数

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

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

目次

リファレンス

ましゅの規則

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

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

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

エクスポート

名前種類概要
checkMasyu関数Validate a Masyu answer against the printed clues and complete native rules.
decodeMasyu関数Read a native saved Masyu game, or null for invalid board data or progress.
encodeMasyu関数Encode the Masyu board and current game as native resumable text.
generateMasyu関数Seeded original loop layouts; every output is accepted only after a completed uniqueness proof.
hintMasyu関数Find a native Masyu hint, or null when no actionable hint is available.
isMasyuBoard関数Whether the value has valid native Masyu dimensions, clues and data.
MASYU_NODE_BUDGET定数The native Masyu search-node budget.
MASYU_SIZES定数The supported Masyu board sizes.
MasyuBoard型Masyu dimensions and printed clues in their native row-major representation.
masyuCellCount関数Count cells in a Masyu board.
MasyuCheck型The Masyu completion result and cells that violate its native rules.
MasyuDrawOptions型Current Masyu marks or entries, selection, errors and native SVG appearance choices.
masyuEdgeCount関数Count native Masyu edges.
masyuFinished関数Whether this Masyu game satisfies its complete native rules.
MasyuGame型The immutable Masyu board, current entries or marks, undo history and assistance state.
MasyuMount型The mounted Masyu game and progress, native controls and cleanup handle.
MasyuMountOptions型The initial Masyu board, native progress, appearance and host event callbacks.
masyuNeighbors関数Read adjacent Masyu cells with the joining edge and direction.
MasyuPuzzle型A seeded Masyu board with its verified solution.
MasyuSolve型A bounded Masyu solve result: answer count, first solution, node work and whether the search completed.
newMasyu関数Create the initial immutable Masyu game from a valid board.
restartMasyu関数Return the Masyu game reset to its initial entries or marks.
solveMasyu関数Counts distinct single loops with local pearl rules; budget stops never claim a proof.
toggleMasyuEdge関数Apply the requested native Masyu entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
undoMasyu関数Return the Masyu game with its previous marks or entries restored, or unchanged when there is no undo history.

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

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