startPresident関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A new game of President for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table President is not offered for. computers says, one a seat, which seats a computer plays; the third argument is unused.
インポート
import { startPresident } from "@johnmorrisdotca/toranpu/president";
定義
function startPresident(size: number, players: readonly string[], _language?: unknown, dealt?: number, computers?: readonly boolean[]): PresidentGame | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
size | number | The game’s length or size, as defined by its table specification. |
players | readonly string[] | The player names in seat order. |
_language (省略可) | unknown | An unused legacy language argument retained for compatibility. |
dealt (省略可) | number | undefined | The numeric seed used to deal the game. |
computers (省略可) | readonly boolean[] | undefined | Flags by seat: true where a computer controls that seat. |
戻り値
PresidentGame | null
A new game of President for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table President is not offered for. computers says, one a seat, which seats a computer plays; the third argument is unused.
例
import { CARD_GAME_TABLES } from "@johnmorrisdotca/toranpu";
import { startPresident } from "@johnmorrisdotca/toranpu/president";
const names = Array.from({ length: CARD_GAME_TABLES.president.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
console.log(startPresident(CARD_GAME_TABLES.president.defaultSize, names, undefined, 42)?.phase);playing出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。