Reference · Rules, generation and deductions
activeCellsfunction
Returns all active cells in stable row-major order.
Import it
import { activeCells } from "@johnmorrisdotca/jirai";
Definition
function activeCells(settings: Settings): number[]
Parameters
| Name | Type | Description |
|---|---|---|
settings | Settings | The validated native field dimensions, mine count, topology, shape, opening, generation policy and numeric seed. |
Returns
number[]
Returns all active cells in stable row-major order.
Examples
import type { Settings } from "@johnmorrisdotca/jirai";
import { activeCells } from "@johnmorrisdotca/jirai";
const settings: Settings={width:3,height:3,mines:1,grid:"square",noGuess:false,opening:"clear",seed:42};
console.log(activeCells(settings));[
0, 1, 2, 3, 4,
5, 6, 7, 8
]What it prints (run when this page was built)