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

isSolvablefunction

Verify a board from one opening, using only clues that have been uncovered.

Import it

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

Definition

function isSolvable(board: Board, enumerate?: boolean): boolean

Parameters

NameTypeDescription
boardBoard

The dealt native field; it includes private answer data.

enumerate (optional)boolean

Whether to include bounded exact frontier enumeration in the deduction/proof check.

Returns

boolean

Verify a board from one opening, using only clues that have been uncovered.

Examples

import type { Settings } from "@johnmorrisdotca/jirai";
import { isSolvable, makeBoard } from "@johnmorrisdotca/jirai";

const settings: Settings={width:3,height:3,mines:1,grid:"square",noGuess:false,opening:"clear",seed:42};
const board=makeBoard(settings,0,{attempts:1,repair:false});
console.log(isSolvable(board));
true

What it prints (run when this page was built)

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