Piecetype
A shape in the tray: its name, its colour, and its cells as row and column from its own top left.
Import it
import type { Piece } from "@johnmorrisdotca/houseki/tsumiki";
Definition
interface Piece {
readonly shape: string;
readonly colour: BlockColour;
readonly cells: readonly (readonly [
number,
number
])[];
}
Members
| Name | Type | Description |
|---|---|---|
shape | string | |
colour | BlockColour | |
cells | readonly (readonly [number, number])[] |
Examples
import type { Piece } from "@johnmorrisdotca/houseki/tsumiki";
const value: Piece = { shape: "bar-2", colour: "blue", cells: [[0, 0], [0, 1]] };
console.log(value.cells.length);2What it prints (run when this page was built)