本文へ移動

Toranpuトランプ

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

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

目次

リファレンス · ユーカー

EuchreGame型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

A GAME OF EUCHRE: its table and moves (what is kept, KeptCardGame), and everything the moves make. Four seats in two partnerships across the table, seats 0 and 2 against 1 and 3. size is the score that wins: 5 or 10.

インポート

import type { EuchreGame } from "@johnmorrisdotca/toranpu/euchre";

定義

type EuchreGame = KeptCardGame<EuchreMove> & {
    deal: number;
    phase: EuchrePhase;
    hands: CardId[][];
    upcard: CardId;
    trump: CardSuit | null;
    maker: number | null;
    passes: number;
    trick: EuchrePlay[];
    lastTrick: {
        plays: EuchrePlay[];
        winner: number;
    } | null;
    played: CardId[];
    toPlay: number | null;
    tricks: number[];
    scores: [
        number,
        number
    ];
    results: EuchreHandScore[];
};

メンバー

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

Which hand this is, from 0: the deal moves one seat round each time.

phaseEuchrePhase
handsstring[][]
upcardstring

The card turned up from the four left over.

trumpCardSuit | null

Trumps, once made; null while the making goes round.

makernumber | null

The seat that made trumps.

passesnumber

How many seats have passed in the making's current round.

trickEuchrePlay[]
lastTrick{ plays: EuchrePlay[]; winner: number; } | null
playedstring[]
toPlaynumber | null
tricksnumber[]

Tricks each seat has taken this hand.

scores[number, number]

Each partnership's points: seats 0 and 2, then 1 and 3.

resultsEuchreHandScore[]

Each finished hand, one row a hand.

例

import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu";
import type { EuchreGame } from "@johnmorrisdotca/toranpu/euchre";

const names = Array.from({ length: CARD_GAME_TABLES.euchre.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
const game = newGame("euchre", { players: names, seed: 42 })!;
const value: EuchreGame = game;
console.log(value.phase);
order

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

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

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