Reference · Number-puzzle engines
regionsAreSoundfunction
Whether region divides a size×size grid into size regions of size cells each, every one of
them joined edge to edge. O(cells): a check of a Jigsaw asks it of whatever regions it was sent.
Import it
import { regionsAreSound } from "@johnmorrisdotca/kazu";
Definition
function regionsAreSound(size: number, region: readonly number[]): boolean
Parameters
| Name | Type | Description |
|---|---|---|
size | number | The supported square grid side length. |
region | readonly number[] | The row-major region number of every cell. |
Returns
boolean
Whether region divides a size×size grid into size regions of size cells each, every one of them joined edge to edge. O(cells): a check of a Jigsaw asks it of whatever regions it was sent.
Examples
import { boxedLayout, regionsAreSound } from "@johnmorrisdotca/kazu";
console.log(regionsAreSound(4,boxedLayout(4).region));trueWhat it prints (run when this page was built)