startEuchrefunction
A new game of Euchre for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table Euchre is not offered for. computers says, one a seat, which seats a computer plays; the third argument is unused.
Import it
import { startEuchre } from "@johnmorrisdotca/toranpu/euchre";
Definition
function startEuchre(size: number, players: readonly string[], _language?: unknown, dealt?: number, computers?: readonly boolean[]): EuchreGame | null
Parameters
| Name | Type | Description |
|---|---|---|
size | number | The game’s length or size, as defined by its table specification. |
players | readonly string[] | The player names in seat order. |
_language (optional) | unknown | An unused legacy language argument retained for compatibility. |
dealt (optional) | number | undefined | The numeric seed used to deal the game. |
computers (optional) | readonly boolean[] | undefined | Flags by seat: true where a computer controls that seat. |
Returns
EuchreGame | null
A new game of Euchre for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table Euchre is not offered for. computers says, one a seat, which seats a computer plays; the third argument is unused.
Examples
import { CARD_GAME_TABLES } from "@johnmorrisdotca/toranpu";
import { startEuchre } from "@johnmorrisdotca/toranpu/euchre";
const names = Array.from({ length: CARD_GAME_TABLES.euchre.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
console.log(startEuchre(CARD_GAME_TABLES.euchre.defaultSize, names, undefined, 42)?.phase);orderWhat it prints (run when this page was built)