Skip to the content

Suido水道

Turn pipes to connect the pumps and drains, through fixed levels or seeded puzzles.

Suido means water supply in Japanese. About the name

Contents

Reference · Playable board

SuidoMountOptionstype

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

Import it

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

Definition

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;
};

Members

NameTypeDescription
codestring

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

answer (optional)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 (optional)string | undefined

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

shown (optional)boolean | undefined

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

turning (optional)SuidoTurning | undefined

Which way a tap turns a piece. Default clockwise.

hints (optional)boolean | undefined

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

controls (optional)boolean | undefined

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

chips (optional)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 (optional)"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 (optional)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 (optional)((detail: SuidoEventDetail) => void) | undefined
onTurn (optional)((detail: SuidoEventDetail) => void) | undefined
onHint (optional)((detail: SuidoEventDetail) => void) | undefined
onTurning (optional)((turning: SuidoTurning) => void) | undefined

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

onSolve (optional)((detail: SuidoEventDetail) => void) | undefined

Examples

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'
}

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/suido 1.7.0.