sortCribbagefunction
A hand sorted as a player holds it: ace low to king, by rank then suit.
Import it
import { sortCribbage } from "@johnmorrisdotca/toranpu/cribbage";
Definition
function sortCribbage(hand: readonly CardId[]): CardId[]
Parameters
| Name | Type | Description |
|---|---|---|
hand | readonly string[] | The player’s held cards, or the hand number for a deal. |
Returns
string[]
A hand sorted as a player holds it: ace low to king, by rank then suit.
Examples
import { sortCribbage } from "@johnmorrisdotca/toranpu/cribbage";
console.log(sortCribbage(["JS", "5H", "AC"]));[ 'AC', '5H', 'JS' ]What it prints (run when this page was built)