本文へ移動

Kazu数

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

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

目次

リファレンス

数字の盤のSVG

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

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

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

Kazu's drawing: a puzzle as SVG text, with the style that gives it its look, and where everything sits in it (so a page can tell which cell a finger is over). A separate entry (@johnmorrisdotca/kazu/draw), so a server that only checks an answer never loads any of it.

エクスポート

名前種類概要
drawKazu関数A PUZZLE AS SVG TEXT: the grid with its printed numbers, whatever has been written in it, pencil marks, and everything the kind of puzzle prints: the heavier rules round the boxes or a Jigsaw's regions, the shaded diagonals, a cage's dashed outline with its sum, the more-than marks between cells, and the tower clues round the edge.
drawShikaku関数SVG text with only the public clues and the player's rectangles.
KAZU_CELL定数The units of a cell, and the margin round the drawing.
KAZU_NAMES定数Bilingual puzzle names, aliases, rules, origins and introductory copy by native kind.
KAZU_SIZE_NAMES定数What each side is for, under its size on a chooser: the quick one, the usual one, the long one.
KAZU_STRINGS定数Native English and Japanese labels, announcements and interpolation templates for the number grid.
KAZU_STYLE定数THE STYLE a Kazu drawing wears: the colours of its board as custom properties, and the one rule that matters for a puzzle played with fingers: nothing in the drawing can be selected, dragged or double-tapped.
kazuCellName関数A cell as a screen reader names it: "row 3, column 5".
KazuDrawOptions型What a drawing shows beyond the puzzle itself.
kazuGeometry関数Where everything is in the drawing of a puzzle of this kind and side.
KazuGeometry型WHERE EVERYTHING IS IN A DRAWING, so a page of your own can play it: the drawing is a square of side units, every cell cell units across, and a Towers square sits inside a ring one cell deep that holds its clues.
KazuLanguage型THE WORDS A KAZU BOARD SAYS, in English and Japanese: what a screen reader hears of the drawing, the buttons and lines under a playable board, and what a hint says.
kazuLanguageOf関数The language a piece of text is in: Japanese for anything starting ja, English for everything else.
KazuName型WHAT EACH PUZZLE IS CALLED, and what it is, in English and Japanese: the name a player searches for, its Japanese name, a line saying how it is played, and a few lines of rules.
kazuNameOf関数What a puzzle is called in a language, as a screen reader says it.
kazuSay関数A line in a language, with its values filled in; the line itself if there is none by that name.
kazuWhere関数The words for the groups a number is ruled out by, for a hint's line: "its row, column and box".
ShikakuDrawOptions型Current Shikaku marks or entries, selection, errors and native SVG appearance choices.

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

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