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

LoopMounttype

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

Import it

import type { LoopMount } from "@johnmorrisdotca/kazu/loop";

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

Definition

type LoopMount = {
    game: () => LoopGame;
    progress: () => string;
    set: (options: LoopDrawOptions) => void;
    restart: () => void;
    destroy: () => void;
};

Members

NameTypeDescription
game() => LoopGame
progress() => string
set(options: LoopDrawOptions) => void
restart() => void
destroy() => void

Examples

import type { LoopBoard, LoopMount } from "@johnmorrisdotca/kazu/loop";
import { mountLoop } from "@johnmorrisdotca/kazu/loop";

const loopBoard: LoopBoard = {"width":5,"height":5,"clues":[2,3,1,null,null,3,1,1,null,null,3,2,2,null,null,3,0,2,2,null,2,2,1,2,3]};
const host = document.createElement("div");
document.body.append(host);
const player: LoopMount = mountLoop(host,{board:loopBoard});
console.log(player.progress());
player.destroy();

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