本文へ移動

Toranpuトランプ

デッキを使い、11種類のゲームでコンピューターと対戦し、ソリティアを解いたり、独自の絵柄でカードを表示したりできます。

「トランプ」は、日本語で playing cards を指す言葉です。 名前について(英語)

目次

リファレンス · オーヘル

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[];
};

メンバー

名前型説明
sizenumber
playersreadonly string[]
computersreadonly boolean[]
seednumber
movesreadonly OhHellMove[]
dealnumber

Which deal this is, from 0.

phaseOhHellPhase
cardsnumber

The cards each seat holds this deal.

handsstring[][]
turnedstring

The card turned up after the deal: its suit is trumps.

trumpCardSuit
bids(number | null)[]
trickOhHellPlay[]
lastTrick{ plays: OhHellPlay[]; winner: number; } | null
playedstring[]

Every card played in a finished trick this deal.

toPlaynumber | null
tricksnumber[]
scoresnumber[]
dealScoresOhHellDealScore[]

例

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/toranpu 2.15.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。