Reference · Game engine and table
sortHitotsufunction
A hand as a player holds it: by colour, numbers then actions, the wilds last.
Import it
import { sortHitotsu } from "@johnmorrisdotca/hitotsu";
Definition
function sortHitotsu(hand: readonly HitotsuCard[]): HitotsuCard[]
Parameters
| Name | Type | Description |
|---|---|---|
hand | readonly string[] | The hand number for deterministic shuffling, or the held cards where an array is accepted. |
Returns
string[]
A hand as a player holds it: by colour, numbers then actions, the wilds last.
Examples
import { sortHitotsu } from "@johnmorrisdotca/hitotsu";
console.log(sortHitotsu(["WW0", "B20", "R70"]));[ 'R70', 'B20', 'WW0' ]What it prints (run when this page was built)