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 player

mountMasyufunction

Mount the native Masyu player in a host element and return its cleanup and control handle.

Import it

import { mountMasyu } from "@johnmorrisdotca/kazu/masyu/play";

Definition

function mountMasyu(element: HTMLElement, initial: MasyuMountOptions): MasyuMount

Parameters

NameTypeDescription
elementHTMLElement

The DOM host receiving the native player.

initialMasyuMountOptions

The valid board, optional native progress, appearance and callbacks.

Returns

MasyuMount

Mount the native Masyu player in a host element and return its cleanup and control handle.

Examples

import type { MasyuBoard } 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 = mountMasyu(host,{board:masyuBoard});
console.log(player.progress());
player.destroy();

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