本文へ移動

Suido水道

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

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

目次

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

BigShape型

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

EVERY BIG PIECE THERE CAN BE. A big piece is four cells, each a small piece of its own, that are joined across the inside wherever both open towards each other and are not joined where neither does (isJoinedInside). So what four one-cell pieces can make side by side, a plate can: a cell with a cross in it, a corner next to a straight, two pipes that never meet, a tee beside an end. Each cell opens on at least one side, no four cells are all joined round the middle (the water would go round in a ring), and every pipe inside has an opening to the outside. That is 699 shapes up to turning, and BIG_SHAPES lists every one, the five BIG_KINDS among them.

A PIPE here is a run of joined cells, and the water in one does not reach another: two pipes side by side are two, however close. A plate has one, two or three, with one to eight openings in all, at most two on each side. A FAMILY is the plates with the same openings on their pipes, written largest first (3+2 is a pipe with three openings and one with two).

インポート

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

定義

type BigShape = {
    id: string;
    masks: readonly [
        number,
        number,
        number,
        number
    ];
    pipes: number;
    openings: number;
    family: string;
    named: BigKind | null;
};

メンバー

名前型説明
idstring

The four masks, hex, of the shape's first facing in order of the masks: the same in every facing a plate is turned to.

masksreadonly [number, number, number, number]

The four cells' masks clockwise from the top left, in the facing that gives the least id.

pipesnumber

How many separate pipes the plate holds, 1 to 3.

openingsnumber

How many openings to the outside, 1 to 8.

familystring

The openings on each pipe, largest first and joined by +: 4, 2+2, 3+1+1.

named"end" | "hairpin" | "straight" | "elbow" | "tee" | null

The kind of BIG_KINDS it is, or null for one of the other shapes.

例

import type { BigShape } from "@johnmorrisdotca/suido";
import { BIG_SHAPES } from "@johnmorrisdotca/suido";

const value: BigShape = BIG_SHAPES[0];
console.log(value);
{
  id: '2c96',
  masks: [ 2, 12, 9, 6 ],
  pipes: 1,
  openings: 1,
  family: '1',
  named: null
}

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

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

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