sortPresidentfunction
Cards in President's order, lowest first, suits in a fixed order only so a hand always sorts the same way.
Import it
import { sortPresident } from "@johnmorrisdotca/toranpu/president";
Definition
function sortPresident(cards: readonly CardId[]): CardId[]
Parameters
| Name | Type | Description |
|---|---|---|
cards | readonly string[] | The cards in their current order. |
Returns
string[]
Cards in President's order, lowest first, suits in a fixed order only so a hand always sorts the same way.
Examples
import { sortPresident } from "@johnmorrisdotca/toranpu/president";
console.log(sortPresident(["2S", "3D", "AC"]));[ '3D', 'AC', '2S' ]What it prints (run when this page was built)