Skip to the content

Toranpuトランプ

Use a deck, play eleven games with computers, solve a solitaire, or display cards in your own design.

Toranpu is Japanese for playing cards. About the name

Contents

Reference · Big Two

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

NameTypeDescription
trickT

The cards and seats in the current trick.

seatnumber

The zero-based player seat.

cardsreadonly 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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/toranpu 2.15.0.