Skip to the content

Jirai地雷

Deal seeded minefields, prove hints from visible clues and mount square, orthogonal, hexagonal or wraparound boards.

Jirai is the Japanese word 地雷 for a land mine. About the name

Contents

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

NameTypeDescription
levelLevel | 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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/jirai 0.5.0.