Reference · Pipes, rules and solving
BlockInfotype
The blocks of a board, in the order of their anchors, and which block each cell is in (-1 for none).
Import it
import type { BlockInfo } from "@johnmorrisdotca/suido";
Definition
type BlockInfo = {
blocks: readonly Block[];
of: Int32Array;
};
Members
| Name | Type | Description |
|---|---|---|
blocks | readonly Block[] | |
of | Int32Array<ArrayBufferLike> |
Examples
import { SUIDO_5X5 } from "@johnmorrisdotca/suido/levels-5x5";
import { blockInfo, decodeLayout } from "@johnmorrisdotca/suido";
import type { BlockInfo } from "@johnmorrisdotca/suido";
const row = SUIDO_5X5[0];
const code = row[0];
const layout = decodeLayout(code)!;
const blockLayout = {...layout,bigs:[0]};
const value: BlockInfo = blockInfo(blockLayout);
console.log(value);{
blocks: [ { index: 0, anchor: 0, big: true, cells: [Array] } ],
of: Int32Array(25) [
0, 0, -1, -1, -1, 0, 0, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1
]
}What it prints (run when this page was built)