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 · Yajilin rules

YajilinMounttype

The mounted Yajilin game and progress, native controls and cleanup handle.

Import it

import type { YajilinMount } from "@johnmorrisdotca/kazu/yajilin";

Also exported from: @johnmorrisdotca/kazu/yajilin/play, @johnmorrisdotca/kazu

Definition

type YajilinMount = {
    game: () => YajilinGame;
    progress: () => string;
    set: (options: YajilinDrawOptions) => void;
    restart: () => void;
    destroy: () => void;
};

Members

NameTypeDescription
game() => YajilinGame
progress() => string
set(options: YajilinDrawOptions) => void
restart() => void
destroy() => void

Examples

import type { YajilinBoard, YajilinMount } from "@johnmorrisdotca/kazu/yajilin";
import { mountYajilin } from "@johnmorrisdotca/kazu/yajilin/play";

const yajilinBoard: YajilinBoard = {"width":5,"height":5,"clues":[{"direction":"left","count":0},null,{"direction":"right","count":1},null,{"direction":"up","count":0},null,null,null,null,null,{"direction":"right","count":0},null,{"direction":"left","count":0},null,{"direction":"down","count":1},{"direction":"left","count":0},null,null,null,null,null,{"direction":"up","count":1},{"direction":"down","count":0},null,{"direction":"down","count":0}]};
const host = document.createElement("div");
document.body.append(host);
const player: YajilinMount = mountYajilin(host,{board:yajilinBoard});
console.log(player.progress());
player.destroy();

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