startStackUpfunction
A new game of Stack Up for two to six players with a stock pile of this size, dealt from the seed, or null for a table it is not offered for.
Import it
import { startStackUp } from "@johnmorrisdotca/toranpu/stack-up";
Definition
function startStackUp(size: number, players: readonly string[], _language?: unknown, dealt?: number, computers?: readonly boolean[]): StackUpGame | null
Parameters
| Name | Type | Description |
|---|---|---|
size | number | The cards in each player's stock pile: 10, 15 or 20. |
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
StackUpGame | null
A new game of Stack Up, or null.
Examples
import { startStackUp } from "@johnmorrisdotca/toranpu/stack-up";
console.log(startStackUp(15, ["Aki", "Ben"], undefined, 42)?.hands[0]?.length);5What it prints (run when this page was built)