laid関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { laid } from "@johnmorrisdotca/toranpu/big-two";
ほかのエクスポート元: @johnmorrisdotca/toranpu/president
定義
function laid<T extends ClimbTrick>(trick: T, seat: number, cards: readonly CardId[]): T | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
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. |
戻り値
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.
例
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' ] }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。