本文へ移動

Kazu数

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

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

目次

リファレンス · 領域の規則

generateRegions関数

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

Makes a seeded puzzle and proves its answer is the only one. The board is cut into connected regions, each holding its own size, with no two of one size touching; every square starts given, and givens are taken away for as long as the puzzle can still be solved the way the level asks: easy and medium by the rules alone (easy keeps most givens), hard by supposing one number at a time, extra-hard for as long as the answer stays single. If no board of the level is found within the attempts the next level down is tried, and a puzzle that gives every square is the last resort.

インポート

import { generateRegions } from "@johnmorrisdotca/kazu/regions";

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

定義

function generateRegions(width?: number, height?: number, level?: RegionsLevel, seed?: number): RegionsPuzzle

引数

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

The supported board width in cells.

height (省略可)number

The supported board height in cells.

level (省略可)RegionsLevel

The requested native difficulty tier.

seed (省略可)number

The reproducible native puzzle seed.

戻り値

RegionsPuzzle

Makes a seeded puzzle and proves its answer is the only one. The board is cut into connected regions, each holding its own size, with no two of one size touching; every square starts given, and givens are taken away for as long as the puzzle can still be solved the way the level asks: easy and medium by the rules alone (easy keeps most givens), hard by supposing one number at a time, extra-hard for as long as the answer stays single. If no board of the level is found within the attempts the next level down is tried, and a puzzle that gives every square is the last resort.

例

import { generateRegions } from "@johnmorrisdotca/kazu/regions";

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

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

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