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;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
id | string | 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. |
masks | readonly [number, number, number, number] | The four cells' masks clockwise from the top left, in the facing that gives the least |
pipes | number | How many separate pipes the plate holds, 1 to 3. |
openings | number | How many openings to the outside, 1 to 8. |
family | string | The openings on each pipe, largest first and joined by |
named | "end" | "hairpin" | "straight" | "elbow" | "tee" | null | The kind of |
例
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
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。