sortHeartsfunction
A hand sorted as a player holds it: clubs, diamonds, spades, hearts, low to high within each.
Import it
import { sortHearts } from "@johnmorrisdotca/toranpu/hearts";
Definition
function sortHearts(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: clubs, diamonds, spades, hearts, low to high within each.
Examples
import { sortHearts } from "@johnmorrisdotca/toranpu/hearts";
console.log(sortHearts(["QS", "2C", "AH"]));[ '2C', 'QS', 'AH' ]What it prints (run when this page was built)