Reference · Rules, generation and deductions
newGamefunction
Creates an unstarted game with covered cells and no dealt answer.
Import it
import { newGame } from "@johnmorrisdotca/jirai";
Definition
function newGame(settings?: Settings): Game
Parameters
| Name | Type | Description |
|---|---|---|
settings (optional) | Settings | The validated native field dimensions, mine count, topology, shape, opening, generation policy and numeric seed. |
Returns
Game
Creates an unstarted game with covered cells and no dealt answer.
Examples
import type { Settings } from "@johnmorrisdotca/jirai";
import { newGame } from "@johnmorrisdotca/jirai";
const settings: Settings={width:3,height:3,mines:1,grid:"square",noGuess:false,opening:"clear",seed:42};
console.log(newGame(settings).status);readyWhat it prints (run when this page was built)