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 · Pipes, rules and solving

hintForfunction

A piece to turn, for a player who asks for help: the first piece that does not face as answer says, nearest the pump first (the water's own order), or null when every piece does. In a drains board a spare piece is never one. In a block it is the block's anchor, the top left cell, whichever piece is out of place.

Import it

import { hintFor } from "@johnmorrisdotca/suido";

Definition

function hintFor(game: Game, answer: readonly number[]): number | null

Parameters

NameTypeDescription
gameGame

The current immutable game state.

answerreadonly number[]

The solved pipe masks or encoded answer specified by the signature.

Returns

number | null

A piece to turn, for a player who asks for help: the first piece that does not face as answer says, nearest the pump first (the water's own order), or null when every piece does. In a drains board a spare piece is never one. In a block it is the block's anchor, the top left cell, whichever piece is out of place.

Examples

import { SUIDO_5X5 } from "@johnmorrisdotca/suido/levels-5x5";
import { levelSolution } from "@johnmorrisdotca/suido/levels";
import { hintFor, newGame } from "@johnmorrisdotca/suido";

const row = SUIDO_5X5[0];
const code = row[0];
const solution = levelSolution(row)!;
const game = newGame(code)!;
console.log(hintFor(game,solution));
0

What it prints (run when this page was built)

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