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

blockInfofunction

The blocks of a board and the block each cell is in; read once for a layout and kept.

Import it

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

Definition

function blockInfo(layout: Pick<Layout, "width" | "height" | "bigs" | "blocks">): BlockInfo

Parameters

NameTypeDescription
layoutPick<Layout, "width" | "height" | "bigs" | "blocks">

The decoded board with its dimensions, pipe masks and rule settings.

Returns

BlockInfo

The blocks of a board and the block each cell is in; read once for a layout and kept.

Examples

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

const row = SUIDO_5X5[0];
const code = row[0];
const layout = decodeLayout(code)!;
const blockLayout = {...layout,bigs:[0]};
console.log(blockInfo(blockLayout).blocks);
[ { index: 0, anchor: 0, big: true, cells: [ 0, 1, 6, 5 ] } ]

What it prints (run when this page was built)

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