centreSquaresfunction
The four centre squares, top-left first. Even boards only; the centre is between four cells.
Import it
import { centreSquares } from "@johnmorrisdotca/narabe";
Definition
function centreSquares(size: number): Point[]
Parameters
| Name | Type | Description |
|---|---|---|
size | number | The number of cells on each side of the board. |
Returns
Point[]
The four centre squares, top-left first. Even boards only; the centre is between four cells.
Examples
import { centreSquares } from "@johnmorrisdotca/narabe";
console.log(centreSquares(8));[
{ row: 3, col: 3 },
{ row: 3, col: 4 },
{ row: 4, col: 3 },
{ row: 4, col: 4 }
]What it prints (run when this page was built)