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

blockQuartersBetweenfunction

How many quarters clockwise, 0 to 3, make the block's pieces in from the ones in to; null when no turn does.

Import it

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

Definition

function blockQuartersBetween(from: readonly number[], to: readonly number[], block: Block): number | null

Parameters

NameTypeDescription
fromreadonly number[]

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

toreadonly number[]

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

blockBlock

The zero-based ladder block index, or decoded four-cell block specified by the signature.

Returns

number | null

How many quarters clockwise, 0 to 3, make the block's pieces in from the ones in to; null when no turn does.

Examples

import { SUIDO_5X5 } from "@johnmorrisdotca/suido/levels-5x5";
import { blockInfo, blockQuartersBetween, decodeLayout, turnBlock } from "@johnmorrisdotca/suido";

const row = SUIDO_5X5[0];
const code = row[0];
const layout = decodeLayout(code)!;
const blockLayout = {...layout,bigs:[0]};
const block = blockInfo(blockLayout).blocks[0];
console.log(blockQuartersBetween(blockLayout.cells,turnBlock(blockLayout.cells,block),block));
1

What it prints (run when this page was built)

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