contractOffunction
A partnership's contract this deal: its bids added, a nil counting none; null while either has still to bid.
Import it
import { contractOf } from "@johnmorrisdotca/toranpu/spades";
Definition
function contractOf(game: SpadesGame, team: 0 | 1): number | null
Parameters
| Name | Type | Description |
|---|---|---|
game | SpadesGame | The current native game; applying a move returns a new state. |
team | 0 | 1 | The zero-based team index. |
Returns
number | null
A partnership's contract this deal: its bids added, a nil counting none; null while either has still to bid.
Examples
import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu";
import { contractOf } 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(contractOf(game, 0));nullWhat it prints (run when this page was built)