Reference · Rules, solvers and generation
neighbourTablefunction
Every cell's neighbours, worked out once for a size.
Import it
import { neighbourTable } from "@johnmorrisdotca/tsunagi";
Definition
function neighbourTable(size: number): number[][]
Parameters
| Name | Type | Description |
|---|---|---|
size | number | The number of cells on each side of the board. |
Returns
number[][]
Every cell's neighbours, worked out once for a size.
Examples
import { neighbourTable } from "@johnmorrisdotca/tsunagi";
console.log(neighbourTable(4)[0]);[ 1, 4 ]What it prints (run when this page was built)