Move型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
ONE CHECKER MOVED BY ONE DIE, in the mover's own numbering: from its own
point from (or the BAR, 25, for a checker entering from the bar or from
off the board at the start of a race) to its own point to (0 for borne
off). A move that lands on a lone checker of the other side hits it.
インポート
import type { Move } from "@johnmorrisdotca/sugoroku";
定義
type Move = {
readonly from: number;
readonly to: number;
readonly die: number;
readonly hit: boolean;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
from | number | |
to | number | |
die | number | The number on the die that moved it. A checker borne off with a larger die than it needed has |
hit | boolean | Whether it hit a checker, which went to the other side's bar. |
例
import { legalPlaysOf, newGame, rollOpening, settingsFor } from "@johnmorrisdotca/sugoroku";
import type { Move } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
const game = rollOpening(newGame(settings),[3,1]);
const play = legalPlaysOf(game)[0];
const move = play.moves[0];
const value: Move = move;
console.log(value);{ from: 24, to: 21, die: 3, hit: false }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。