sortCrazyfunction
A hand as a player holds it: eights last, the rest by suit and rank.
Import it
import { sortCrazy } from "@johnmorrisdotca/toranpu/crazy-eights";
Definition
function sortCrazy(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: eights last, the rest by suit and rank.
Examples
import { sortCrazy } from "@johnmorrisdotca/toranpu/crazy-eights";
console.log(sortCrazy(["8H", "AS", "2C"]));[ '2C', 'AS', '8H' ]What it prints (run when this page was built)