crazyEightsWinnersfunction
The highest score wins, once somebody reaches the game's size; level on it shares the win.
Import it
import { crazyEightsWinners } from "@johnmorrisdotca/toranpu/crazy-eights";
Definition
function crazyEightsWinners(game: CrazyEightsGame): number[]
Parameters
| Name | Type | Description |
|---|---|---|
game | CrazyEightsGame | The current native game; applying a move returns a new state. |
Returns
number[]
The highest score wins, once somebody reaches the game's size; level on it shares the win.
Examples
import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu";
import { crazyEightsWinners } from "@johnmorrisdotca/toranpu/crazy-eights";
const names = Array.from({ length: CARD_GAME_TABLES.crazyEights.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
let game = newGame("crazyEights", { players: names, seed: 42 })!;
console.log(crazyEightsWinners(game));[]What it prints (run when this page was built)