Reference · Mazes, arrows and mixed boards
triangleGridfunction
Rows of triangles, each pointing up or down in turn, w to a row; a cell is up when its column and row make an even number.
Import it
import { triangleGrid } from "@johnmorrisdotca/meikyuu";
Definition
function triangleGrid(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
Rows of triangles, each pointing up or down in turn, w to a row; a cell is up when its column and row make an even number.
Examples
import { triangleGrid } from "@johnmorrisdotca/meikyuu";
console.log(triangleGrid(5,5).cells);25What it prints (run when this page was built)