rollOpening関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The opening throw: one die for white and one for black. The higher starts.
A tie changes nothing but opening, and the sides throw again. In a game
opened with a roll-off the starter plays the two dice as the first roll;
otherwise the starter then rolls as usual.
インポート
import { rollOpening } from "@johnmorrisdotca/sugoroku";
定義
function rollOpening(game: GameState, throws: readonly [number, number]): GameState
引数
| 名前 | 型 | 説明 |
|---|---|---|
game | GameState | The current immutable native game state. |
throws | readonly [number, number] | The opening die for white, then black. |
戻り値
GameState
The opening throw: one die for white and one for black. The higher starts. A tie changes nothing but opening, and the sides throw again. In a game opened with a roll-off the starter plays the two dice as the first roll; otherwise the starter then rolls as usual.
例
import { newGame, rollOpening, settingsFor } from "@johnmorrisdotca/sugoroku";
const settings = settingsFor("backgammon",{points:5,cube:true});
console.log(rollOpening(newGame(settings),[3,1]).turn);white出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。