startTrain関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A new game: the set (its highest double), the names at the table (one a
seat), which seats a computer plays, the options, and the seed every
shuffle is drawn from. Null for a table the game is not offered for — a set
not in PARTY_SPECS, or too few or too many players — rather than a game
nobody chose.
インポート
import { startTrain } from "@johnmorrisdotca/domino";
定義
function startTrain(set: number, players: readonly string[], seed?: number, options?: TrainOptions, computers?: readonly boolean[]): TrainGame | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
set | number | The highest double of the supported set: 9, 12 or 15. |
players | readonly string[] | Player count, or names in seat order, as specified by this signature. |
seed (省略可) | number | The seed for reproducible shuffles. |
options (省略可) | TrainOptions | Native sound-player choices or Mexican Train house rules specified by the signature. |
computers (省略可) | readonly boolean[] | Which seats are computer-controlled, in player order. |
戻り値
TrainGame | null
The seeded game, or null for an unsupported set or player count.
例
import { startTrain } from "@johnmorrisdotca/domino";
console.log(startTrain(9,["A","B"],42)?.hands.map(hand=>hand.length));[ 10, 10 ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。