本文へ移動

Suido水道

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

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

目次

リファレンス · 管・ルール・解法

MakeOptions型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

What a new board may be asked for. Everything has a default but the seed, and a seed has one too.

インポート

import type { MakeOptions } from "@johnmorrisdotca/suido";

定義

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;
};

メンバー

名前型説明
seed (省略可)number | undefined

The same seed and the same options make the same board, in every browser and every Node.

size (省略可)number | undefined

The side of a square board; or width and height for one that is not. Default 7.

width (省略可)number | undefined
height (省略可)number | undefined
kind (省略可)Kind | undefined

network (every piece wet), drains (every drain reached, spare pieces allowed) or inlet-outlet (the water runs in one path from the pump at the top left to the drain at the bottom right, through pieces that open on two sides; the rest are decoys). Default network. An inlet-outlet board has one pump and one drain and its edges do not join.

wrap (省略可)boolean | undefined

Whether the edges join. Default false.

sources (省略可)number | undefined

How many pumps. Default 1.

drains (省略可)number | undefined

In a drains board, how many drains. Default about four fifths of the board's side, at least one a pump.

spares (省略可)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 (省略可)number | undefined

How the pipes wind, 0 to 1: low branches everywhere, high runs in long snakes. Default is drawn from the seed.

locked (省略可)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 (省略可)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 (省略可)number | undefined

How many big pieces: squares of four cells that are one piece, turned in place a quarter at a time (see BIG_KINDS). Only a network has them. Fewer are made where the board has no room. Default 0.

bigKinds (省略可)BigMix | undefined

Which big pieces bigs draws from: five, the five kinds of BIG_KINDS (the default, so a seed makes the board it always made), simple, more or all of the 699 shapes of BIG_SHAPES, each a wider choice than the one before (BigMix): pipes side by side, a cross or a tee inside a plate, three pipes in one, few openings or many.

blocks (省略可)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 (省略可)number | undefined

The difficulty to aim for, 1 to 100 among boards of the size (see difficultyOf). Boards are made until one is near it.

attempts (省略可)number | undefined

How many boards to make, at most, looking for the difficulty asked for. Default 60.

tolerance (省略可)number | undefined

How far from the difficulty asked for is near enough. Default 4.

例

import type { MakeOptions } from "@johnmorrisdotca/suido";

const value: MakeOptions = {size:5,seed:42,kind:"network"};
console.log(value);
{ size: 5, seed: 42, kind: 'network' }

出力(このページを作ったときに実行した結果)

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

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