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

needsZoomfunction

Whether the pieces of a board across a box boxPx wide are smaller than a thumb is comfortable with, so that a board offers to be zoomed.

Import it

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

Definition

function needsZoom(layout: { width: number; }, boxPx: number, smallest?: number): boolean

Parameters

NameTypeDescription
layout{ width: number; }

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

boxPxnumber

The available viewport width in pixels.

smallest (optional)number

The minimum desirable cell width in pixels.

Returns

boolean

Whether the pieces of a board across a box boxPx wide are smaller than a thumb is comfortable with, so that a board offers to be zoomed.

Examples

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

const row = SUIDO_5X5[0];
const code = row[0];
const layout = decodeLayout(code)!;
console.log(needsZoom(layout,390));
false

What it prints (run when this page was built)

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