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

gameProgressfunction

Keep settings and moves, never an unchecked answer array. Version the deal before changing it.

Import it

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

Definition

function gameProgress(game: Game): string

Parameters

NameTypeDescription
gameGame

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

Returns

string

Keep settings and moves, never an unchecked answer array. Version the deal before changing it.

Examples

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

const settings: Settings={width:3,height:3,mines:1,grid:"square",noGuess:false,opening:"clear",seed:42};
const game=play(newGame(settings),{kind:"reveal",cell:0});
console.log(gameProgress(game));
{"version":1,"settings":{"width":3,"height":3,"mines":1,"grid":"square","noGuess":false,"opening":"clear","seed":42},"moves":[{"kind":"reveal","cell":0}],"helped":false}

What it prints (run when this page was built)

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