本文へ移動

Kazu数

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

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

目次

リファレンス · 数字パズルのエンジン

KAZU_BOXES定数

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

A 9×9 has 3×3 boxes and a 4×4 has 2×2; a 6×6 has boxes two rows tall and three columns wide, which is the one people get wrong and the reason this is a table rather than a square root.

インポート

import { KAZU_BOXES } from "@johnmorrisdotca/kazu";

定義

const KAZU_BOXES: Record<number, Boxes> = {
    4: { rows: 2, cols: 2 },
    6: { rows: 2, cols: 3 },
    9: { rows: 3, cols: 3 },
    16: { rows: 4, cols: 4 },
    25: { rows: 5, cols: 5 },
}

例

import { KAZU_BOXES } from "@johnmorrisdotca/kazu";
console.log(KAZU_BOXES);
{
  '4': { rows: 2, cols: 2 },
  '6': { rows: 2, cols: 3 },
  '9': { rows: 3, cols: 3 },
  '16': { rows: 4, cols: 4 },
  '25': { rows: 5, cols: 5 }
}

出力(このページを作ったときに実行した結果)

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

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