SlideMove型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What a record needs of a move to say whether it slid, jumped, or went on jumping.
インポート
import type { SlideMove } from "@johnmorrisdotca/narabe";
定義
type SlideMove = {
kind: string;
row: number;
col: number;
from?: Point;
captured?: readonly unknown[];
continuedChain?: boolean;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
kind | string | |
row | number | |
col | number | |
from (省略可) | Point | undefined | |
captured (省略可) | readonly unknown[] | undefined | The pieces this move took, where the engine replayed it (a draughts jump takes one). |
continuedChain (省略可) | boolean | undefined | A later hop of one piece's multi-jump: it starts where the last capture landed. |
例
import type { SlideMove } from "@johnmorrisdotca/narabe";
const value: SlideMove = {kind:"move",row:3,col:2,from:{row:5,col:0}};
console.log(value);{ kind: 'move', row: 3, col: 2, from: { row: 5, col: 0 } }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。