Reference · Rules, generation and deductions
Boardtype
A dealt board including its answer; keep it off public clients.
Import it
import type { Board } from "@johnmorrisdotca/jirai";
Definition
type Board = {
settings: Settings;
mines: readonly boolean[];
clues: readonly number[];
first: number;
attempt: number;
};
Members
| Name | Type | Description |
|---|---|---|
settings | Settings | |
mines | readonly boolean[] | |
clues | readonly number[] | |
first | number | |
attempt | number | Which candidate this deal was: below the |
Examples
import type { Board, Settings } from "@johnmorrisdotca/jirai";
import { makeBoard } from "@johnmorrisdotca/jirai";
const settings: Settings={width:3,height:3,mines:1,grid:"square",noGuess:false,opening:"clear",seed:42};
const board=makeBoard(settings,0,{attempts:1,repair:false});
const value: Board = board;
console.log(value);{
settings: {
width: 3,
height: 3,
mines: 1,
grid: 'square',
noGuess: false,
opening: 'clear',
seed: 42
},
mines: [
false, false,
true, false,
false, false,
false, false,
false
],
clues: [
0, 1, -1, 0, 1,
1, 0, 0, 0
],
first: 0,
attempt: 0
}What it prints (run when this page was built)