sortGoFishfunction
A hand as a player holds it: grouped by rank, ace to king.
Import it
import { sortGoFish } from "@johnmorrisdotca/toranpu/go-fish";
Definition
function sortGoFish(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 as a player holds it: grouped by rank, ace to king.
Examples
import { sortGoFish } from "@johnmorrisdotca/toranpu/go-fish";
console.log(sortGoFish(["AS", "AH", "2C"]));[ 'AH', 'AS', '2C' ]What it prints (run when this page was built)