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

SolveResulttype

What the solver found.

Import it

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

Definition

type SolveResult = {
    count: number;
    solutions: number[][];
    nodes: number;
    branches: number;
    forced: number;
    complete: boolean;
};

Members

NameTypeDescription
countnumber

How many answers there are, counted up to the limit asked for.

solutionsnumber[][]

Each answer found, as the sides every piece opens on. In a drains board a piece the water does not reach stays as it was given.

nodesnumber

The positions the search looked at, and how many of them had more than one way on to try.

branchesnumber
forcednumber

The pieces fixed by deduction alone, before the search had to guess anything.

completeboolean

False when the budget ran out before the search was finished: count is then only how many were found so far.

Examples

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

const row = SUIDO_5X5[0];
const code = row[0];
const layout = decodeLayout(code)!;
const value: SolveResult = solve(layout,2,20000);
console.log(value);
{
  count: 1,
  solutions: [
    [
       6, 10, 10, 10,  8,  5,  2, 10,
      12,  4,  7, 14, 10, 15, 13,  5,
       3,  8,  1,  5,  3, 10, 10,  8,
       1
    ]
  ],
  nodes: 1,
  branches: 0,
  forced: 25,
  complete: true
}

What it prints (run when this page was built)

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