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

playfunction

A legal move returns a new game; an unavailable move returns the same one.

Import it

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

Definition

function play(game: Game, move: Move): Game

Parameters

NameTypeDescription
gameGame

The native game, or answer-free VisibleGame required by the signature.

moveMove

A native reveal, mark-cycle or chord with its row-major active-cell index.

Returns

Game

A legal move returns a new game; an unavailable move returns the same one.

Examples

import type { Settings } from "@johnmorrisdotca/jirai";
import { newGame, play } from "@johnmorrisdotca/jirai";

const settings: Settings={width:3,height:3,mines:1,grid:"square",noGuess:false,opening:"clear",seed:42};
console.log(play(newGame(settings),{kind:"reveal",cell:0}).status);
won

What it prints (run when this page was built)

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