Reference · Pipes, rules and solving
MakeOptionstype
What a new board may be asked for. Everything has a default but the seed, and a seed has one too.
Import it
import type { MakeOptions } from "@johnmorrisdotca/suido";
Definition
type MakeOptions = {
seed?: number;
size?: number;
width?: number;
height?: number;
kind?: Kind;
wrap?: boolean;
sources?: number;
drains?: number;
spares?: number;
bias?: number;
locked?: number;
walls?: number;
bigs?: number;
bigKinds?: BigMix;
blocks?: number;
difficulty?: number;
attempts?: number;
tolerance?: number;
};
Members
| Name | Type | Description |
|---|---|---|
seed (optional) | number | undefined | The same seed and the same options make the same board, in every browser and every Node. |
size (optional) | number | undefined | The side of a square board; or |
width (optional) | number | undefined | |
height (optional) | number | undefined | |
kind (optional) | Kind | undefined |
|
wrap (optional) | boolean | undefined | Whether the edges join. Default false. |
sources (optional) | number | undefined | How many pumps. Default 1. |
drains (optional) | number | undefined | In a drains board, how many drains. Default about four fifths of the board's side, at least one a pump. |
spares (optional) | number | undefined | In a drains board, the share of the ground the water does not need that holds a spare piece, the rest bare. Default 0.5. |
bias (optional) | number | undefined | How the pipes wind, 0 to 1: low branches everywhere, high runs in long snakes. Default is drawn from the seed. |
locked (optional) | number | undefined | How many pieces are locked: shown facing as the answer has them and not to be turned. Where a board would have a second answer, a locked piece is what makes it one before any pipe is moved. Default 0. |
walls (optional) | number | undefined | How many walls: edges the water cannot cross, put where the pipes do not go. Where a board would have a second answer, a wall across the edge the other answer uses is what makes it one. Default 0. |
bigs (optional) | number | undefined | How many big pieces: squares of four cells that are one piece, turned in place a quarter at a time (see
|
bigKinds (optional) | BigMix | undefined | Which big pieces |
blocks (optional) | number | undefined | How many blocks that turn as one: squares of four ordinary pieces that a tap turns together, the pieces moving round the square as they turn. Only a network has them. Default 0. |
difficulty (optional) | number | undefined | The difficulty to aim for, 1 to 100 among boards of the size (see |
attempts (optional) | number | undefined | How many boards to make, at most, looking for the difficulty asked for. Default 60. |
tolerance (optional) | number | undefined | How far from the difficulty asked for is near enough. Default 4. |
Examples
import type { MakeOptions } from "@johnmorrisdotca/suido";
const value: MakeOptions = {size:5,seed:42,kind:"network"};
console.log(value);{ size: 5, seed: 42, kind: 'network' }What it prints (run when this page was built)