Reference · Mazes, arrows and mixed boards
hexGridfunction
Columns by rows of hexagons, pointy side up, every odd row shifted half a cell right.
Import it
import { hexGrid } from "@johnmorrisdotca/meikyuu";
Definition
function hexGrid(w: number, h: number): Grid
Parameters
| Name | Type | Description |
|---|---|---|
w | number | The native grid width in cells. |
h | number | The native grid height in cells. |
Returns
Grid
Columns by rows of hexagons, pointy side up, every odd row shifted half a cell right.
Examples
import { hexGrid } from "@johnmorrisdotca/meikyuu";
console.log(hexGrid(5,5).cells);25What it prints (run when this page was built)