formatPlay関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The text of a whole turn: moves of one checker joined, equal moves counted, the farthest-back checker first. A turn of no moves is -.
インポート
import { formatPlay } from "@johnmorrisdotca/sugoroku";
定義
function formatPlay(moves: readonly Move[]): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
moves | readonly Move[] | Legal checker moves in their played order. |
戻り値
string
The text of a whole turn: moves of one checker joined, equal moves counted, the farthest-back checker first. A turn of no moves is -.
例
import { formatPlay, legalPlaysOf, newGame, rollOpening, settingsFor } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
const game = rollOpening(newGame(settings),[3,1]);
const play = legalPlaysOf(game)[0];
console.log(formatPlay(play.moves));24/21 24/23出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。