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 · Load fixed levels

turnsOffunction

The answer to a board as one digit a cell: how many quarter turns clockwise each piece needs, the fewest. Null when solution is not the board's pieces turned.

Import it

import { turnsOf } from "@johnmorrisdotca/suido/levels";

Also exported from: @johnmorrisdotca/suido/levels-info

Definition

function turnsOf(layout: Layout, solution: readonly number[]): string | null

Parameters

NameTypeDescription
layoutLayout

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

solutionreadonly number[]

The solved pipe masks in row-major cell order.

Returns

string | null

The answer to a board as one digit a cell: how many quarter turns clockwise each piece needs, the fewest. null when solution is not the board's pieces turned.

Examples

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

const row = SUIDO_5X5[0];
const code = row[0];
const layout = decodeLayout(code)!;
const solution = levelSolution(row)!;
console.log(turnsOf(layout,solution));
1101202133111021323101003

What it prints (run when this page was built)

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