Reference · Pipes, rules and solving
bigShapeOffunction
Which shape four masks make, and the fewest quarters clockwise from the shape's own facing (BigShape.masks) that bring it to them;
null for four masks that are none of the 699: a blank cell, a ring, a pipe with no opening to the outside.
Import it
import { bigShapeOf } from "@johnmorrisdotca/suido";
Definition
function bigShapeOf(masks: readonly number[]): { shape: BigShape; quarters: number; } | null
Parameters
| Name | Type | Description |
|---|---|---|
masks | readonly number[] | Current pipe masks in row-major cell order. |
Returns
{ shape: BigShape; quarters: number; } | null
Which shape four masks make, and the fewest quarters clockwise from the shape's own facing (BigShape.masks) that bring it to them; null for four masks that are none of the 699: a blank cell, a ring, a pipe with no opening to the outside.
Examples
import { bigMasksOf, bigShapeOf } from "@johnmorrisdotca/suido";
console.log(bigShapeOf(bigMasksOf("elbow",0))?.shape.id);53a3What it prints (run when this page was built)