OhHellGame型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A GAME OF OH HELL: its table and moves (what is kept, KeptCardGame), and
everything the moves make. Three or four seats, each for itself. size is
how many deals: 7 (one card, then two, up to seven) or 13 (up to seven and
back down to one).
インポート
import type { OhHellGame } from "@johnmorrisdotca/toranpu/oh-hell";
定義
type OhHellGame = KeptCardGame<OhHellMove> & {
deal: number;
phase: OhHellPhase;
cards: number;
hands: CardId[][];
turned: CardId;
trump: CardSuit;
bids: (number | null)[];
trick: OhHellPlay[];
lastTrick: {
plays: OhHellPlay[];
winner: number;
} | null;
played: CardId[];
toPlay: number | null;
tricks: number[];
scores: number[];
dealScores: OhHellDealScore[];
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
size | number | |
players | readonly string[] | |
computers | readonly boolean[] | |
seed | number | |
moves | readonly OhHellMove[] | |
deal | number | Which deal this is, from 0. |
phase | OhHellPhase | |
cards | number | The cards each seat holds this deal. |
hands | string[][] | |
turned | string | The card turned up after the deal: its suit is trumps. |
trump | CardSuit | |
bids | (number | null)[] | |
trick | OhHellPlay[] | |
lastTrick | { plays: OhHellPlay[]; winner: number; } | null | |
played | string[] | Every card played in a finished trick this deal. |
toPlay | number | null | |
tricks | number[] | |
scores | number[] | |
dealScores | OhHellDealScore[] |
例
import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu";
import type { OhHellGame } from "@johnmorrisdotca/toranpu/oh-hell";
const names = Array.from({ length: CARD_GAME_TABLES.ohHell.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
const game = newGame("ohHell", { players: names, seed: 42 })!;
const value: OhHellGame = game;
console.log(value.phase);bidding出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。