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
| Name | Type | Description |
|---|---|---|
hand | readonly 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)