Skip to the content

Kazu数

Generate checked Sudoku and logic puzzles, read native rules and hints, and draw or embed playable boards.

Kazu is the Japanese word 数 for number. About the name

Contents

Reference · Shikaku rules

ShikakuRectangletype

A rectangle uses zero-based column and row coordinates.

Import it

import type { ShikakuRectangle } from "@johnmorrisdotca/kazu/shikaku";

Also exported from: @johnmorrisdotca/kazu

Definition

type ShikakuRectangle = {
    x: number;
    y: number;
    width: number;
    height: number;
};

Members

NameTypeDescription
xnumber
ynumber
widthnumber
heightnumber

Examples

import type { ShikakuPuzzle, ShikakuRectangle } from "@johnmorrisdotca/kazu/shikaku";

const shikakuSolution: ShikakuPuzzle["solution"] = [{"x":0,"y":0,"width":3,"height":1},{"x":3,"y":0,"width":2,"height":1},{"x":1,"y":1,"width":4,"height":1},{"x":4,"y":2,"width":1,"height":3},{"x":0,"y":1,"width":1,"height":4},{"x":1,"y":2,"width":1,"height":3},{"x":2,"y":2,"width":2,"height":3}];
const value: ShikakuRectangle = shikakuSolution[0];
console.log(value);
{ x: 0, y: 0, width: 3, height: 1 }

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kazu 2.1.0.