本文へ移動

Suido水道

管を回してポンプと排水口をつなぎます。収録された問題やシード付きの問題で遊べます。

「水道」は、水を届ける設備を表す言葉です。 名前について(英語)

目次

リファレンス

SVGの盤

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

最小化と gzip 圧縮をしたサイズは 7.2 kB(読み込むものをすべて含み、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.

エクスポート

名前種類概要
ArmState型What the water does at one opening of a piece.
attachSuidoView関数Lets the box box move and zoom the board drawn in svg (which must have a viewBox of the whole board).
boxOf関数The size of a board in the drawing's units.
CellState型How one cell is to look.
cellStates関数The state of every piece of a board whose pieces face as masks say.
clampView関数A view kept inside the board, never further in than most and never showing past an edge.
drawGuidePiece関数A 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.
DrawOptions型What to draw with.
drawPiece関数One piece on its own, as SVG text: for a legend, an icon, or a page that shows how the pieces look.
drawSuido関数A board as SVG text.
drawSuidoThumb関数A 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.
needsZoom関数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.
paintSuido関数Update the existing board SVG with current facings and water, returning its flow state.
panView関数A view moved by (dx, dy) in the drawing's units.
stepFor関数The milliseconds the water takes through one cell, so that the deepest cell is reached in FILL_MS at most.
SUIDO_FIT定数The whole board.
SUIDO_MOST_ZOOM定数The furthest in a view goes: this many times the whole board.
SUIDO_STYLE定数THE 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.
SuidoBox型A board's size in the drawing's units: a hundred across a cell.
SuidoView型The 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.
SuidoViewer型What attachSuidoView hands back.
SuidoViewerOptions型What a viewer may be asked for.
viewBoxOf関数The viewBox that shows a view.
viewShowing関数The 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.
zoomAbout関数A view zoomed by factor about the point (ax, ay) of the board, which stays under the same place in the box.

ソースを見るGitHub で編集@johnmorrisdotca/suido 1.7.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。