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

cribbagePlayablefunction

The cards a seat may play on the count now: any that keeps it to thirty-one.

Import it

import { cribbagePlayable } from "@johnmorrisdotca/toranpu/cribbage";

Definition

function cribbagePlayable(hand: readonly CardId[], count: number): CardId[]

Parameters

NameTypeDescription
handreadonly string[]

The player’s held cards, or the hand number for a deal.

countnumber

The requested number of cards, sounds or layout positions.

Returns

string[]

The cards a seat may play on the count now: any that keeps it to thirty-one.

Examples

import { cribbagePlayable } from "@johnmorrisdotca/toranpu/cribbage";

console.log(cribbagePlayable(["AS", "5H", "KS"], 25));
[ 'AS', '5H' ]

What it prints (run when this page was built)

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