本文へ移動

Kazu数

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

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

目次

リファレンス

ぬりかべの規則

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

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

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

エクスポート

名前種類概要
checkNurikabe関数Checks island areas and separation, the connected sea, and the ban on 2×2 sea blocks.
decodeNurikabe関数Read a native saved Nurikabe game, or null for invalid board data or progress.
encodeNurikabe関数Encode the Nurikabe board and current game as native resumable text.
generateNurikabe関数Seeded symmetries of original 5×5 layouts are returned only after the solver proves uniqueness.
hintNurikabe関数Find a native Nurikabe hint, or null when no actionable hint is available.
isNurikabeBoard関数Whether the value has valid native Nurikabe dimensions, clues and data.
markNurikabeSea関数Apply the requested native Nurikabe entry or mark to a new immutable game; invalid or fixed targets stay unchanged.
newNurikabe関数Create the initial immutable Nurikabe game from a valid board.
NURIKABE_MAX_NODES定数The native Nurikabe search-node budget.
NURIKABE_SIZES定数The supported Nurikabe board sizes.
NurikabeBoard型Nurikabe dimensions and printed clues in their native row-major representation.
NurikabeGame型The immutable Nurikabe board, current entries or marks, undo history and assistance state.
nurikabeNeighbors関数Read orthogonally adjacent cells on a square Nurikabe board.
NurikabePuzzle型A seeded Nurikabe board with its verified solution.
NurikabeSolve型A bounded Nurikabe solve result: answer count, first solution, node work and whether the search completed.
restartNurikabe関数Return the Nurikabe game reset to its initial entries or marks.
solveNurikabe関数Counts valid island placements and checks the remaining cells as the sea under a finite budget.
undoNurikabe関数Return the Nurikabe game with its previous marks or entries restored, or unchanged when there is no undo history.

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

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