Reference · Rules, generation and deductions
levelSettingsfunction
The size and mine count of a level. A rectangle gets the level's own numbers; a shaped board keeps the level's
width and height and its density of mines over the cells that are left. Throws RangeError for a name that is no level.
Import it
import { levelSettings } from "@johnmorrisdotca/jirai";
Definition
function levelSettings(level: Level | LevelAlias, board?: { grid?: Grid; shape?: Settings["shape"]; }): LevelSize
Parameters
| Name | Type | Description |
|---|---|---|
level | Level | LevelAlias | A native easy, medium, hard or extra-hard level, or a supported older level alias. |
board (optional) | { grid?: Grid; shape?: Settings["shape"]; } | The dealt native field; it includes private answer data. |
Returns
LevelSize
The size and mine count of a level. A rectangle gets the level's own numbers; a shaped board keeps the level's width and height and its density of mines over the cells that are left. Throws RangeError for a name that is no level.
Examples
import { levelSettings } from "@johnmorrisdotca/jirai";
console.log(levelSettings("easy",{grid:"orthogonal"}));{ width: 9, height: 9, mines: 10 }What it prints (run when this page was built)