Skip to the content

Toranpuトランプ

Use a deck, play eleven games with computers, solve a solitaire, or display cards in your own design.

Toranpu is Japanese for playing cards. About the name

Contents

Reference · Cribbage

CribbageHandScoretype

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

Import it

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

Definition

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

Members

NameTypeDescription
dealernumber
starterstring
hands[string[], string[]]
cribstring[]
counts[CribbageCount, CribbageCount]
cribCountCribbageCount

Examples

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

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/toranpu 2.15.0.