本文へ移動

Kazu数

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

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

目次

リファレンス

四角に切れの規則

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

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

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

Shikaku shares Kazu's number puzzle package, with its own rectangle model.

エクスポート

名前種類概要
checkShikaku関数A finished partition is checked against the rules, never against a stored answer.
decodeShikaku関数Read a native saved Shikaku game, or null for invalid board data or progress.
encodeShikaku関数Versioned public puzzle and placement data, with no hidden answer.
generateShikaku関数Seeded rectangles packed into the board, one number each, with an independently counted, unique answer.
generateShikakuChallenge関数Generate a seeded Shikaku puzzle with a verified unique answer; unsupported inputs or exhausted attempts throw.
hintShikaku関数A rectangle is offered only when the remaining partition has one proved answer.
isShikakuBoard関数Whether dimensions and area clues describe a possible partition.
newShikaku関数Begin with a copy of just the public clues; a generated answer is never kept in play.
placeShikaku関数Place a rectangle, replacing any it touches.
rateShikaku関数Rates a board with one answer by solving it with the first rule, with the first two, with all three, then by supposing.
removeShikaku関数Remove the rectangle containing a cell.
SHIKAKU_CHALLENGE_PACKS定数Three short, named challenge routes using the regular seeded unique-puzzle generator.
SHIKAKU_LEVELS定数How hard a puzzle is made, by what a person must do to solve it; see rateShikaku.
SHIKAKU_MOST_ATTEMPTS定数The native Shikaku generation-attempt limit.
SHIKAKU_MOST_NODES定数The native Shikaku search-node budget.
SHIKAKU_MOST_SIDE定数Bounds keep custom boards and searches finite.
SHIKAKU_SIZES定数The sides on offer for a square board; any side from 2 to SHIKAKU_MOST_SIDE can be made.
ShikakuBoard型One area clue per rectangle; zero is an unnumbered cell.
shikakuCandidates関数All legal rectangles for a numbered cell, in a stable order.
shikakuCells関数Cells of a bounded rectangle, or null for invalid coordinates.
ShikakuChallenge型The named route, board shape, difficulty and seed of one Shikaku challenge.
ShikakuChallengePuzzle型A named Shikaku challenge paired with its generated unique puzzle.
ShikakuCheck型The Shikaku completion result and cells that violate its native rules.
shikakuFinished関数Whether this Shikaku game satisfies its complete native rules.
ShikakuGame型The immutable Shikaku board, current entries or marks, undo history and assistance state.
ShikakuLevel型A native difficulty tier for generated Shikaku puzzles.
ShikakuPackKey型One of the square, wide or tall native Shikaku challenge routes.
ShikakuPuzzle型A seeded Shikaku board with its verified solution and native difficulty tier.
ShikakuRating型How hard a board is, measured by solving it.
ShikakuRectangle型A rectangle uses zero-based column and row coordinates.
ShikakuSolve型A bounded Shikaku solve result: answer count, first solution, node work and whether the search completed.
solveShikaku関数Exact cover over squares.
undoShikaku関数Return the Shikaku game with its previous marks or entries restored, or unchanged when there is no undo history.

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

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