MasyuGame型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The immutable Masyu board, current entries or marks, undo history and assistance state.
インポート
import type { MasyuGame } from "@johnmorrisdotca/kazu/masyu";
ほかのエクスポート元: @johnmorrisdotca/kazu
定義
type MasyuGame = {
board: MasyuBoard;
edges: readonly number[];
history: readonly (readonly number[])[];
helped: boolean;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
board | MasyuBoard | |
edges | readonly number[] | |
history | readonly (readonly number[])[] | |
helped | boolean |
例
import type { MasyuBoard, MasyuGame } from "@johnmorrisdotca/kazu/masyu";
import { newMasyu } from "@johnmorrisdotca/kazu/masyu";
const masyuBoard: MasyuBoard = {"width":5,"height":5,"pearls":[2,1,0,1,2,1,0,0,0,1,2,1,0,1,2,0,0,0,0,0,0,0,0,0,0]};
const masyuGame = newMasyu(masyuBoard);
const value: MasyuGame = masyuGame;
console.log(value);{
board: {
width: 5,
height: 5,
pearls: [
2, 1, 0, 1, 2, 1, 0, 0,
0, 1, 2, 1, 0, 1, 2, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0
]
},
edges: [],
history: [],
helped: false
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。