本文へ移動

Suido水道

管を回してポンプと排水口をつなぎます。収録された問題やシード付きの問題で遊べます。

「水道」は、水を届ける設備を表す言葉です。 名前について(英語)

目次

リファレンス · 遊べる盤

SuidoMountOptions型

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

The initial puzzle, native controls, language and event callbacks for mounting a board.

インポート

import type { SuidoMountOptions } from "@johnmorrisdotca/suido/play";

定義

type SuidoMountOptions = {
    code: string;
    answer?: string;
    progress?: string;
    shown?: boolean;
    turning?: SuidoTurning;
    hints?: boolean;
    controls?: boolean;
    chips?: boolean;
    zoom?: "auto" | "off";
    language?: SuidoLanguage;
    onChange?: (detail: SuidoEventDetail) => void;
    onTurn?: (detail: SuidoEventDetail) => void;
    onHint?: (detail: SuidoEventDetail) => void;
    onTurning?: (turning: SuidoTurning) => void;
    onSolve?: (detail: SuidoEventDetail) => void;
};

メンバー

名前型説明
codestring

The board, as its code (makeSuido(...).code, or a level's row[0]).

answer (省略可)string | undefined

The board's one answer, as a code (levelAnswer(row), makeSuido(...).answer). With it Hint is offered if hints is on, and the meter says par. Ignored if it is not an answer to the board.

progress (省略可)string | undefined

A game half played, as gameProgress or an event's progress wrote it.

shown (省略可)boolean | undefined

Open on the answer, saying it was solved before, until the next turn. Needs answer.

turning (省略可)SuidoTurning | undefined

Which way a tap turns a piece. Default clockwise.

hints (省略可)boolean | undefined

Offer Hint, which lights a piece to turn. Needs answer. Default false.

controls (省略可)boolean | undefined

The buttons and the lines of words under the board. Default true.

chips (省略可)boolean | undefined

A row of chips under the board: each twist the board has, or Plain, each with the line that explains it as its hover text. Default false.

zoom (省略可)"auto" | "off" | undefined

auto (the default): a board too big for a thumb to press its pieces can be zoomed and moved about. off: never.

language (省略可)SuidoLanguage | undefined

The language the words are in. Left out, the host's own lang, or the page's, and it follows the page's.

onChange (省略可)((detail: SuidoEventDetail) => void) | undefined
onTurn (省略可)((detail: SuidoEventDetail) => void) | undefined
onHint (省略可)((detail: SuidoEventDetail) => void) | undefined
onTurning (省略可)((turning: SuidoTurning) => void) | undefined

Told when the way a tap turns is changed, by the board's own button or by set.

onSolve (省略可)((detail: SuidoEventDetail) => void) | undefined

例

import { SUIDO_5X5 } from "@johnmorrisdotca/suido/levels-5x5";
import { levelAnswer } from "@johnmorrisdotca/suido/levels";
import type { SuidoMountOptions } from "@johnmorrisdotca/suido/play";

const row = SUIDO_5X5[0];
const code = row[0];
const answer = levelAnswer(row)!;
const value: SuidoMountOptions = {code,answer,controls:true,language:"en"};
console.log(value);
{
  code: '5x5:j5a5C5I59Ib75f7a6CCa35aIC',
  answer: '5x5:maaaI5CacE7eafd53IB53aaIB',
  controls: true,
  language: 'en'
}

出力(このページを作ったときに実行した結果)

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

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