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