本文へ移動

Kazu数

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

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

目次

リファレンス · ひとりにしてくれの規則

generateHitori関数

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

Makes a seeded puzzle and proves its answer is the only one. The shaded squares are chosen first (never touching, the rest in one piece), the white squares get numbers that repeat nowhere in their row or column, and every shaded square takes a number that a white square in its row or column already has. Boards with more than one answer are repaired by renumbering a shaded square so that the other answer repeats a number, and the result is rated: easy by the plain rules, medium once the whites must stay in one piece, hard by supposing, and extra-hard the most-supposing of several boards.

インポート

import { generateHitori } from "@johnmorrisdotca/kazu/hitori";

ほかのエクスポート元: @johnmorrisdotca/kazu

定義

function generateHitori(size?: number, seed?: number, level?: HitoriLevel): HitoriPuzzle

引数

名前型説明
size (省略可)number

The supported square board side length.

seed (省略可)number

The reproducible native puzzle seed.

level (省略可)HitoriLevel

The requested native difficulty tier.

戻り値

HitoriPuzzle

Makes a seeded puzzle and proves its answer is the only one. The shaded squares are chosen first (never touching, the rest in one piece), the white squares get numbers that repeat nowhere in their row or column, and every shaded square takes a number that a white square in its row or column already has. Boards with more than one answer are repaired by renumbering a shaded square so that the other answer repeats a number, and the result is rated: easy by the plain rules, medium once the whites must stay in one piece, hard by supposing, and extra-hard the most-supposing of several boards.

例

import { generateHitori } from "@johnmorrisdotca/kazu/hitori";

console.log(generateHitori(5,42,"easy"));

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

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