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

MasyuMounttype

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

Import it

import type { MasyuMount } from "@johnmorrisdotca/kazu/masyu";

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

Definition

type MasyuMount = {
    game: () => MasyuGame;
    progress: () => string;
    set: (options: MasyuDrawOptions) => void;
    restart: () => void;
    destroy: () => void;
};

Members

NameTypeDescription
game() => MasyuGame
progress() => string
set(options: MasyuDrawOptions) => void
restart() => void
destroy() => void

Examples

import type { MasyuBoard, MasyuMount } from "@johnmorrisdotca/kazu/masyu";
import { mountMasyu } from "@johnmorrisdotca/kazu/masyu/play";

const masyuBoard: MasyuBoard = {"width":5,"height":5,"pearls":[2,1,0,1,2,1,0,0,0,1,2,1,0,1,2,0,0,0,0,0,0,0,0,0,0]};
const host = document.createElement("div");
document.body.append(host);
const player: MasyuMount = mountMasyu(host,{board:masyuBoard});
console.log(player.progress());
player.destroy();

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