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 · Nurikabe player

mountNurikabefunction

A keyboard- and touch-friendly Nurikabe player, mounted in any host element.

Import it

import { mountNurikabe } from "@johnmorrisdotca/kazu/nurikabe/play";

Definition

function mountNurikabe(host: HTMLElement, initial: NurikabeMountOptions): NurikabeMount

Parameters

NameTypeDescription
hostHTMLElement

The DOM host receiving the native player.

initialNurikabeMountOptions

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

Returns

NurikabeMount

A keyboard- and touch-friendly Nurikabe player, mounted in any host element.

Examples

import type { NurikabeBoard } from "@johnmorrisdotca/kazu/nurikabe";
import { mountNurikabe } from "@johnmorrisdotca/kazu/nurikabe/play";

const nurikabeBoard: NurikabeBoard = {"size":5,"clues":[1,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,2,0,0,3,0,0]};
const host = document.createElement("div");
document.body.append(host);
const player = mountNurikabe(host,{board:nurikabeBoard});
console.log(player.progress());
player.destroy();

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