Reference · Rules, solvers and generation
hexNeighbourTablefunction
Every cell's six neighbours on the hexagon lattice, worked out once for a size.
Import it
import { hexNeighbourTable } from "@johnmorrisdotca/tsunagi";
Definition
function hexNeighbourTable(size: number): number[][]
Parameters
| Name | Type | Description |
|---|---|---|
size | number | The number of cells on each side of the board. |
Returns
number[][]
Every cell's six neighbours on the hexagon lattice, worked out once for a size.
Examples
import { hexNeighbourTable } from "@johnmorrisdotca/tsunagi";
console.log(hexNeighbourTable(7)[24]);[ 17, 18, 25, 31, 30, 23 ]What it prints (run when this page was built)