本文へ移動

Toranpuトランプ

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

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

目次

リファレンス · クリベッジ

CribbageHandScore型

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

One hand as it was shown: the dealer, the starter, both four-card hands and the crib, and what each counted.

インポート

import type { CribbageHandScore } from "@johnmorrisdotca/toranpu/cribbage";

定義

type CribbageHandScore = {
    dealer: number;
    starter: CardId;
    hands: [
        CardId[],
        CardId[]
    ];
    crib: CardId[];
    counts: [
        CribbageCount,
        CribbageCount
    ];
    cribCount: CribbageCount;
};

メンバー

名前型説明
dealernumber
starterstring
hands[string[], string[]]
cribstring[]
counts[CribbageCount, CribbageCount]
cribCountCribbageCount

例

import type { CribbageHandScore } from "@johnmorrisdotca/toranpu/cribbage";
import { showCount } from "@johnmorrisdotca/toranpu/cribbage";

const value: CribbageHandScore = { dealer: 0, starter: "5S", hands: [["5H", "5D", "5C", "JS"], ["AH", "2D", "3C", "4S"]], crib: ["6H", "7D", "8C", "9S"], counts: [showCount(["5H", "5D", "5C", "JS"], "5S"), showCount(["AH", "2D", "3C", "4S"], "5S")], cribCount: showCount(["6H", "7D", "8C", "9S"], "5S", true) };
console.log(value.cribCount.total);
9

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

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

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