spadesMovesfunction
Every move the seat to play may make now; none once the game is over.
Import it
import { spadesMoves } from "@johnmorrisdotca/toranpu/spades";
Definition
function spadesMoves(game: SpadesGame): SpadesMove[]
Parameters
| Name | Type | Description |
|---|---|---|
game | SpadesGame | The current native game; applying a move returns a new state. |
Returns
SpadesMove[]
Every move the seat to play may make now; none once the game is over.
Examples
import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu";
import { spadesMoves } from "@johnmorrisdotca/toranpu/spades";
const names = Array.from({ length: CARD_GAME_TABLES.spades.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
let game = newGame("spades", { players: names, seed: 42 })!;
console.log(spadesMoves(game));[
{ bid: 0 }, { bid: 1 },
{ bid: 2 }, { bid: 3 },
{ bid: 4 }, { bid: 5 },
{ bid: 6 }, { bid: 7 },
{ bid: 8 }, { bid: 9 },
{ bid: 10 }, { bid: 11 },
{ bid: 12 }, { bid: 13 }
]What it prints (run when this page was built)