本文へ移動

Kazu数

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

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

目次

リファレンス · 数字の盤のSVG

KazuDrawOptions型

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

What a drawing shows beyond the puzzle itself. Every part is optional: a puzzle alone is its printed grid.

インポート

import type { KazuDrawOptions } from "@johnmorrisdotca/kazu/draw";

定義

type KazuDrawOptions = {
    entries?: readonly number[];
    notes?: readonly number[];
    selected?: number | null;
    peers?: boolean;
    conflicts?: readonly number[];
    wrong?: readonly number[];
    hint?: number | null;
    done?: boolean;
    interactive?: boolean;
    language?: KazuLanguage;
    label?: string;
    style?: boolean;
    frame?: boolean;
};

メンバー

名前型説明
entries (省略可)readonly number[] | undefined

What the player has written, row-major, 0 for empty.

notes (省略可)readonly number[] | undefined

Pencil marks, a bit mask a cell: bit v is the note v (notesOf).

selected (省略可)number | null | undefined

The chosen cell.

peers (省略可)boolean | undefined

Wash the chosen cell's row, column and group, and every cell holding its number.

conflicts (省略可)readonly number[] | undefined

Cells that break a rule, drawn in red with their numbers (conflictsOf).

wrong (省略可)readonly number[] | undefined

Cells Check flagged wrong.

hint (省略可)number | null | undefined

The cell a hint pointed at.

done (省略可)boolean | undefined

A faint wash of green, and data-solved="true".

interactive (省略可)boolean | undefined

Put a transparent square over every cell, each with its data-cell, for a page to press on. mountKazu does.

language (省略可)KazuLanguage | undefined

What a screen reader hears.

label (省略可)string | undefined

A description instead of "Sudoku puzzle, 9 by 9".

style (省略可)boolean | undefined

Put KAZU_STYLE inside, so the drawing stands alone as an image.

frame (省略可)boolean | undefined

Draw the wooden frame round the paper. Default false.

例

import type { KazuDrawOptions } from "@johnmorrisdotca/kazu/draw";

const value: KazuDrawOptions = {language:"en",peers:true};
console.log(value);
{ language: 'en', peers: true }

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

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

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