laidfunction
The trick after seat lays these cards on it: out of their hand, on the table, and seen by all. Null if they do not hold them.
Import it
import { laid } from "@johnmorrisdotca/toranpu/big-two";
Also exported from: @johnmorrisdotca/toranpu/president
Definition
function laid<T extends ClimbTrick>(trick: T, seat: number, cards: readonly CardId[]): T | null
Parameters
| Name | Type | Description |
|---|---|---|
trick | T | The cards and seats in the current trick. |
seat | number | The zero-based player seat. |
cards | readonly string[] | The cards in their current order. |
Returns
T | null
The trick after seat lays these cards on it: out of their hand, on the table, and seen by all. null if they do not hold them.
Examples
import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu";
import { laid } from "@johnmorrisdotca/toranpu/big-two";
const names = Array.from({ length: CARD_GAME_TABLES.bigTwo.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
let game = newGame("bigTwo", { players: names, seed: 42 })!;
console.log(laid(game, game.toPlay!, [game.hands[game.toPlay!]![0]!])?.pile);{ seat: 2, cards: [ '3D' ] }What it prints (run when this page was built)