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 · React player

JiraiBoardfunction

Renders the DOM player inside a React-owned host. Options are read on mount; use a new key to load a new board.

Import it

import { JiraiBoard } from "@johnmorrisdotca/jirai/react";

Definition

function JiraiBoard({ settings, progress, material, pieces, language, controls, onChange, onFinish, onError, ...element }: JiraiProps): React.JSX.Element

Parameters

NameTypeDescription
optionsJiraiProps

Initial field/progress, presentation, DOM host properties and native callbacks.

Returns

React.JSX.Element

The React element owning a host for the native Minesweeper player.

Examples

import type { Settings } from "@johnmorrisdotca/jirai";
import { JiraiBoard } from "@johnmorrisdotca/jirai/react";

const settings: Settings={width:3,height:3,mines:1,grid:"square",noGuess:false,opening:"clear",seed:42};
import { createElement } from "react";
console.log(createElement(JiraiBoard,{settings,language:"ja"}).type);

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