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

tapsBetweenfunction

The taps it takes to face a piece the right way when a tap turns it one way only (both false) or either way (both true, the shorter of the two).

Import it

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

Definition

function tapsBetween(from: number, to: number, both?: boolean): number | null

Parameters

NameTypeDescription
fromnumber

The original pipe mask or mask array specified by the signature.

tonumber

The desired pipe mask or mask array specified by the signature.

both (optional)boolean

Whether turns may go clockwise or anticlockwise.

Returns

number | null

The fewest permitted taps, or null when the two masks have different shapes.

Examples

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

console.log(tapsBetween(3,6,true));
1

What it prints (run when this page was built)

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