Reference · Pipes, rules and solving
BIG_FAMILIESconstant
The families of BIG_SHAPES, each with how many shapes it holds, in the order they first appear there.
Import it
import { BIG_FAMILIES } from "@johnmorrisdotca/suido";
Definition
const BIG_FAMILIES: readonly { family: string; pipes: number; openings: number; shapes: number; }[] = (() => {
const out = new Map<string, {
family: string;
pipes: number;
openings: number;
shapes: number;
}>();
for (const shape of BIG_SHAPES) {
const kept = out.get(shape.family) ?? {
family: shape.family,
pipes: shape.pipes,
openings: shape.openings,
shapes: 0,
};
kept.shapes += 1;
out.set(shape.family, kept);
}
return [...out.values()];
})()
Examples
import { BIG_FAMILIES } from "@johnmorrisdotca/suido";
console.log(BIG_FAMILIES);[
{ family: '1', pipes: 1, openings: 1, shapes: 8 },
{ family: '2', pipes: 1, openings: 2, shapes: 28 },
{ family: '3', pipes: 1, openings: 3, shapes: 56 },
{ family: '4', pipes: 1, openings: 4, shapes: 70 },
{ family: '5', pipes: 1, openings: 5, shapes: 56 },
{ family: '6', pipes: 1, openings: 6, shapes: 28 },
{ family: '7', pipes: 1, openings: 7, shapes: 8 },
{ family: '8', pipes: 1, openings: 8, shapes: 1 },
{ family: '1+1', pipes: 2, openings: 2, shapes: 22 },
{ family: '2+1', pipes: 2, openings: 3, shapes: 60 },
{ family: '3+1', pipes: 2, openings: 4, shapes: 56 },
{ family: '2+2', pipes: 2, openings: 4, shapes: 36 },
{ family: '4+1', pipes: 2, openings: 5, shapes: 34 },
{ family: '3+2', pipes: 2, openings: 5, shapes: 44 },
{ family: '5+1', pipes: 2, openings: 6, shapes: 12 },
{ family: '4+2', pipes: 2, openings: 6, shapes: 21 },
{ family: '3+3', pipes: 2, openings: 6, shapes: 10 },
{ family: '6+1', pipes: 2, openings: 7, shapes: 2 },
{ family: '5+2', pipes: 2, openings: 7, shapes: 6 },
{ family: '4+3', pipes: 2, openings: 7, shapes: 4 },
{ family: '6+2', pipes: 2, openings: 8, shapes: 1 },
{ family: '4+4', pipes: 2, openings: 8, shapes: 1 },
{ family: '1+1+1', pipes: 3, openings: 3, shapes: 16 },
{ family: '2+1+1', pipes: 3, openings: 4, shapes: 40 },
{ family: '3+1+1', pipes: 3, openings: 5, shapes: 16 },
{ family: '2+2+1', pipes: 3, openings: 5, shapes: 28 },
{ family: '4+1+1', pipes: 3, openings: 6, shapes: 4 },
{ family: '3+2+1', pipes: 3, openings: 6, shapes: 16 },
{ family: '2+2+2', pipes: 3, openings: 6, shapes: 6 },
{ family: '4+2+1', pipes: 3, openings: 7, shapes: 4 },
{ family: '3+2+2', pipes: 3, openings: 7, shapes: 4 },
{ family: '4+2+2', pipes: 3, openings: 8, shapes: 1 }
]What it prints (run when this page was built)