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

BlockInfotype

The blocks of a board, in the order of their anchors, and which block each cell is in (-1 for none).

Import it

import type { BlockInfo } from "@johnmorrisdotca/suido";

Definition

type BlockInfo = {
    blocks: readonly Block[];
    of: Int32Array;
};

Members

NameTypeDescription
blocksreadonly Block[]
ofInt32Array<ArrayBufferLike>

Examples

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

const row = SUIDO_5X5[0];
const code = row[0];
const layout = decodeLayout(code)!;
const blockLayout = {...layout,bigs:[0]};
const value: BlockInfo = blockInfo(blockLayout);
console.log(value);
{
  blocks: [ { index: 0, anchor: 0, big: true, cells: [Array] } ],
  of: Int32Array(25) [
     0,  0, -1, -1, -1,  0,  0, -1,
    -1, -1, -1, -1, -1, -1, -1, -1,
    -1, -1, -1, -1, -1, -1, -1, -1,
    -1
  ]
}

What it prints (run when this page was built)

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