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

cribPairsfunction

Every way to lay two of a hand away.

Import it

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

Definition

function cribPairs(hand: readonly CardId[]): [CardId, CardId][]

Parameters

NameTypeDescription
handreadonly string[]

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

Returns

[string, string][]

Every way to lay two of a hand away.

Examples

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

console.log(cribPairs(["AS", "2H", "3D", "4C", "5S", "6H"]).slice(0, 3));
[ [ 'AS', '2H' ], [ 'AS', '3D' ], [ 'AS', '4C' ] ]

What it prints (run when this page was built)

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