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 · Native Minesweeper player

MountOptionstype

Initial game, appearance, control, and lifecycle callbacks for a mounted board.

Import it

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

Definition

type MountOptions = DrawOptions & {
    settings?: Settings;
    progress?: string;
    controls?: boolean;
    onChange?: (game: Game) => void;
    onFinish?: (game: Game) => void;
    onError?: (error: Error) => void;
};

Members

NameTypeDescription
material (optional)Material | undefined
pieces (optional)Pieces | undefined
language (optional)Language | undefined
hint (optional)number | null | undefined
settings (optional)Settings | undefined
progress (optional)string | undefined
controls (optional)boolean | undefined
onChange (optional)((game: Game) => void) | undefined
onFinish (optional)((game: Game) => void) | undefined
onError (optional)((error: Error) => void) | undefined

Examples

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

const settings: Settings={width:3,height:3,mines:1,grid:"square",noGuess:false,opening:"clear",seed:42};
const value: MountOptions = {settings,language:"ja",material:"wood",pieces:"flags"};
console.log(value);
{
  settings: {
    width: 3,
    height: 3,
    mines: 1,
    grid: 'square',
    noGuess: false,
    opening: 'clear',
    seed: 42
  },
  language: 'ja',
  material: 'wood',
  pieces: 'flags'
}

What it prints (run when this page was built)

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