Suido documentation
Suido 水道 — Pipe-connecting puzzle
Turn pipes to connect the pumps and drains, through fixed levels or seeded puzzles.
Install
npm install @johnmorrisdotca/suido
Start here
Entry points
| Import it | What it is | Size |
|---|---|---|
@johnmorrisdotca/SVG board · 25 exports | 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. | 7.2 kB |
@johnmorrisdotca/Playable board · 11 exports | Suido, played in a page: mountSuido draws a board into any element and plays it by tap, mouse and keyboard, with the water flowing as pipes join, a hint, Start over, and the words in English and Japanese. | 15.7 kB |
@johnmorrisdotca/Board element · 4 exports | 451.6 kB | |
@johnmorrisdotca/Register the board · 4 exports | Defines the <suido-board> element on the page. | 451.6 kB |
@johnmorrisdotca/Load fixed levels · 56 exports | 450.0 kB | |
@johnmorrisdotca/Level metadata · 49 exports | EVERYTHING ABOUT SUIDO'S LEVELS BUT THE LEVELS: @johnmorrisdotca/suido/levels-info. | 4.6 kB |
@johnmorrisdotca/5 × 5 levels · 1 exports | 7.4 kB | |
@johnmorrisdotca/6 × 6 levels · 1 exports | 10.2 kB | |
@johnmorrisdotca/7 × 7 levels · 1 exports | 13.3 kB | |
@johnmorrisdotca/8 × 8 levels · 1 exports | 17.1 kB | |
@johnmorrisdotca/9 × 9 levels · 1 exports | 21.3 kB | |
@johnmorrisdotca/10 × 10 levels · 1 exports | 25.8 kB | |
@johnmorrisdotca/11 × 11 levels · 1 exports | 30.6 kB | |
@johnmorrisdotca/12 × 12 levels · 1 exports | 36.3 kB | |
@johnmorrisdotca/13 × 13 levels · 1 exports | 42.2 kB | |
@johnmorrisdotca/14 × 14 levels · 1 exports | 48.6 kB | |
@johnmorrisdotca/5 × 7 levels · 1 exports | 9.9 kB | |
@johnmorrisdotca/6 × 10 levels · 1 exports | 16.2 kB | |
@johnmorrisdotca/8 × 14 levels · 1 exports | 28.7 kB | |
@johnmorrisdotca/20 × 20 levels · 1 exports | 24.2 kB | |
@johnmorrisdotca/28 × 28 levels · 1 exports | 46.3 kB | |
@johnmorrisdotca/20 × 50 levels · 1 exports | 58.7 kB | |
@johnmorrisdotca/Big-piece levels · 1 exports | 12.7 kB | |
@johnmorrisdotca/Difficulty and lesson marks · 2 exports | EVERY SUIDO LEVEL'S DIFFICULTY, 1 TO 5: one digit a level, level 1 first, from its measured score (difficulty.ts, 1 to 100 among boards of its size) in steps of twenty: the marks a level shows. | 0.8 kB |
@johnmorrisdotca/Pipes, rules and solving · 128 exports | Pipe masks, board codes, water flow, game state, bounded solvers and seeded puzzle generation. | 46.1 kB |
Guides
How-to
- Load fixed and daily levelsLoad only one size and select the shared UTC daily puzzle.
- Keep and restore progressStore native progress with the original puzzle code.
- Draw boards and pipe piecesRender SVG without mounting a game.
- Generate and verify a puzzleUse reproducible seeds and distinguish a proof from an exhausted search.
- Embed a native boardMount or register the board and handle its native events.
- Plain HTML and CDNsPut a Suido board on a plain page with one script tag from jsDelivr or unpkg.
- Embed in an iframeShow a Suido board on a page that cannot run script, with one iframe of the embed page.
- Vite and webpackInstall the package and import the board element in a Vite or webpack project.
- React, Vue, Svelte and AngularUse the board element in React, Vue, Svelte and Angular, with the import that keeps a server render working.
- TypeScript and NodeUse the package's types, and run the rules on a server with no DOM.
Explanation
- Pipe masks and water rulesUnderstand cell indices, masks, spare pipes and block rotations.
- Architecture and difficultyKeep pure rules separate from rendering and interpret difficulty scores.