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

validCellfunction

Reports whether a row-major cell is inside the board's active shape.

Import it

import { validCell } from "@johnmorrisdotca/jirai";

Definition

function validCell(settings: Settings, cell: number): boolean

Parameters

NameTypeDescription
settingsSettings

The validated native field dimensions, mine count, topology, shape, opening, generation policy and numeric seed.

cellnumber

An active native cell index in row-major board order.

Returns

boolean

Reports whether a row-major cell is inside the board's active shape.

Examples

import type { Settings } from "@johnmorrisdotca/jirai";
import { validCell } from "@johnmorrisdotca/jirai";

const settings: Settings={width:3,height:3,mines:1,grid:"square",noGuess:false,opening:"clear",seed:42};
console.log(validCell(settings,8));
true

What it prints (run when this page was built)

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