本文へ移動

Kazu数

検証済みの数独や論理パズルを作り、標準の規則とヒントを読み、盤を描いたり埋め込んだりできます。

「数」は数字を表す言葉です。 名前について(英語)

目次

リファレンス · 波及効果の規則

mountRipple関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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

インポート

import { mountRipple } from "@johnmorrisdotca/kazu/ripple";

ほかのエクスポート元: @johnmorrisdotca/kazu/ripple/play, @johnmorrisdotca/kazu

定義

function mountRipple(host: HTMLElement, initial: RippleMountOptions): RippleMount

引数

名前型説明
hostHTMLElement

The DOM host receiving the native player.

initialRippleMountOptions

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

戻り値

RippleMount

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

例

import type { RippleBoard } from "@johnmorrisdotca/kazu/ripple";
import { mountRipple } from "@johnmorrisdotca/kazu/ripple";

const rippleBoard: RippleBoard = {"width":9,"height":9,"rooms":[0,0,0,1,1,1,2,2,2,0,0,0,1,1,1,2,2,2,0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,3,3,3,4,4,4,5,5,5,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,8,8,8,6,6,6,7,7,7,8,8,8,6,6,6,7,7,7,8,8,8],"clues":[4,null,7,9,2,null,5,null,3,null,null,3,6,7,4,8,9,2,8,null,2,1,3,null,null,null,null,7,null,1,null,6,null,null,null,9,3,8,null,5,1,7,null,null,6,2,4,6,null,9,3,7,5,1,1,null,8,null,5,null,9,2,4,null,2,null,null,null,null,null,null,null,6,null,null,2,4,null,null,3,null]};
const host = document.createElement("div");
document.body.append(host);
const player = mountRipple(host,{board:rippleBoard});
console.log(player.progress());
player.destroy();

ソースを見るGitHub で編集@johnmorrisdotca/kazu 2.1.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。