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

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

7.2 kB minified and gzipped, with everything it imports (measured with esbuild)

Suido's drawing: SVG text for a board and a piece, the style that turns the drawing into flowing water, and the function that paints a board in play. A separate entry (@johnmorrisdotca/suido/draw), so a server that only checks an answer never loads any of it.

Exports

NameKindWhat it is
ArmStatetypeWhat the water does at one opening of a piece.
attachSuidoViewfunctionLets the box box move and zoom the board drawn in svg (which must have a viewBox of the whole board).
boxOffunctionThe size of a board in the drawing's units.
CellStatetypeHow one cell is to look.
cellStatesfunctionThe state of every piece of a board whose pieces face as masks say.
clampViewfunctionA view kept inside the board, never further in than most and never showing past an edge.
drawGuidePiecefunctionA piece of the guide (SUIDO_PIECE_GUIDE) as SVG text: its tiny board drawn by drawSuido, with the water in it where the guide says the picture has some, and the piece's name as its description for a screen reader.
DrawOptionstypeWhat to draw with.
drawPiecefunctionOne piece on its own, as SVG text: for a legend, an icon, or a page that shows how the pieces look.
drawSuidofunctionA board as SVG text.
drawSuidoThumbfunctionA board as a small picture, in a few dozen elements however big the board is: for a page that shows a whole block of levels at once.
needsZoomfunctionWhether 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.
paintSuidofunctionUpdate the existing board SVG with current facings and water, returning its flow state.
panViewfunctionA view moved by (dx, dy) in the drawing's units.
stepForfunctionThe milliseconds the water takes through one cell, so that the deepest cell is reached in FILL_MS at most.
SUIDO_FITconstantThe whole board.
SUIDO_MOST_ZOOMconstantThe furthest in a view goes: this many times the whole board.
SUIDO_STYLEconstantTHE STYLE a Suido board is drawn with: colours as custom properties, the water's flow as transitions, and the one rule that matters for a game played with fingers: nothing on the board can be selected, dragged or double-tapped.
SuidoBoxtypeA board's size in the drawing's units: a hundred across a cell.
SuidoViewtypeThe part of a board shown: how far in (1 is the whole board), and where its top left corner is, in the drawing's units.
SuidoViewertypeWhat attachSuidoView hands back.
SuidoViewerOptionstypeWhat a viewer may be asked for.
viewBoxOffunctionThe viewBox that shows a view.
viewShowingfunctionThe view moved the least that shows the whole of a cell (a margin of half a cell round it where there is room), and no further in than it was.
zoomAboutfunctionA view zoomed by factor about the point (ax, ay) of the board, which stays under the same place in the box.

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