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 · Four-neighbour rules

newOrthogonalGamefunction

Starts a game under four-neighbour rules.

Import it

import { newOrthogonalGame } from "@johnmorrisdotca/jirai/orthogonal";

Also exported from: @johnmorrisdotca/jirai

Definition

function newOrthogonalGame(settings: OrthogonalSettings): Game

Parameters

NameTypeDescription
settingsOrthogonalSettings

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

Returns

Game

Starts a game under four-neighbour rules.

Examples

import type { OrthogonalSettings } from "@johnmorrisdotca/jirai/orthogonal";
import { newOrthogonalGame } from "@johnmorrisdotca/jirai/orthogonal";

const orthogonalSettings: OrthogonalSettings={width:3,height:3,mines:1,noGuess:false,opening:"clear",seed:42};
console.log(newOrthogonalGame(orthogonalSettings).status);
ready

What it prints (run when this page was built)

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