crazyTopfunction
The card on top of the discard pile.
Import it
import { crazyTop } from "@johnmorrisdotca/toranpu/crazy-eights";
Definition
function crazyTop(game: CrazyEightsGame): CardId
Parameters
| Name | Type | Description |
|---|---|---|
game | CrazyEightsGame | The current native game; applying a move returns a new state. |
Returns
string
The card on top of the discard pile.
Examples
import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu";
import { crazyTop } 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(crazyTop(game));6SWhat it prints (run when this page was built)