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 · SVG board

drawSuidofunction

A board as SVG text. The pieces face as options.masks say, with the water in them as it runs from the pumps through every opening that meets another. The drawing is class="suido"; its colours and its flowing are SUIDO_STYLE.

Import it

import { drawSuido } from "@johnmorrisdotca/suido/draw";

Definition

function drawSuido(layout: Layout, options?: DrawOptions): string

Parameters

NameTypeDescription
layoutLayout

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

options (optional)DrawOptions

Drawing, mounting or generator choices specified by the signature.

Returns

string

A board as SVG text. The pieces face as options.masks say, with the water in them as it runs from the pumps through every opening that meets another. The drawing is class="suido"; its colours and its flowing are SUIDO_STYLE.

Examples

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

const row = SUIDO_5X5[0];
const code = row[0];
const layout = decodeLayout(code)!;
console.log(drawSuido(layout,{label:"Sample board"}).startsWith("<svg"));
true

What it prints (run when this page was built)

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