Reference · Pipes, rules and solving
blockInfofunction
The blocks of a board and the block each cell is in; read once for a layout and kept.
Import it
import { blockInfo } from "@johnmorrisdotca/suido";
Definition
function blockInfo(layout: Pick<Layout, "width" | "height" | "bigs" | "blocks">): BlockInfo
Parameters
| Name | Type | Description |
|---|---|---|
layout | Pick<Layout, "width" | "height" | "bigs" | "blocks"> | The decoded board with its dimensions, pipe masks and rule settings. |
Returns
BlockInfo
The blocks of a board and the block each cell is in; read once for a layout and kept.
Examples
import { SUIDO_5X5 } from "@johnmorrisdotca/suido/levels-5x5";
import { blockInfo, decodeLayout } from "@johnmorrisdotca/suido";
const row = SUIDO_5X5[0];
const code = row[0];
const layout = decodeLayout(code)!;
const blockLayout = {...layout,bigs:[0]};
console.log(blockInfo(blockLayout).blocks);[ { index: 0, anchor: 0, big: true, cells: [ 0, 1, 6, 5 ] } ]What it prints (run when this page was built)