BigTwoGame型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A GAME OF BIG TWO: its table and moves (what is kept), and the deal they
have reached. size is how many deals the game lasts: 1, 3 or 5.
インポート
import type { BigTwoGame } from "@johnmorrisdotca/toranpu/big-two";
定義
type BigTwoGame = KeptCardGame<ClimbMove> & ClimbTrick & {
deal: number;
phase: "playing" | "over";
opening: CardId | null;
penalties: number[];
deals: {
winner: number;
charged: number[];
}[];
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
size | number | |
players | readonly string[] | |
computers | readonly boolean[] | |
seed | number | |
moves | readonly ClimbMove[] | |
hands | string[][] | |
pile | ClimbPlay | null | The cards to beat, or null when the seat to play leads. |
passed | boolean[] | Who has passed on this trick: they wait until it is cleared. |
toPlay | number | null | Whose move it is; null once the game is over. |
played | string[] | Every card played this deal, in order: what the whole table has seen. |
deal | number | Which deal this is, from 0. |
phase | "playing" | "over" | |
opening | string | null | The lowest card dealt, which the first play of the deal must include; null once it has been played. |
penalties | number[] | Each seat's penalty points so far: the lowest total wins. |
deals | { winner: number; charged: number[]; }[] | Each finished deal: who went out, and what every seat was charged. |
例
import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu";
import type { BigTwoGame } from "@johnmorrisdotca/toranpu/big-two";
const names = Array.from({ length: CARD_GAME_TABLES.bigTwo.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
const game = newGame("bigTwo", { players: names, seed: 42 })!;
const value: BigTwoGame = game;
console.log(value.phase);playing出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。