Reference · Rules, tiles and records
sortHandfunction
The hand in order (John, 2026-09-28: "it gets sorted for letters alphabetically"): English A to Z, Japanese あいうえお, which is the order of the kana's tile codes, and the wilds last as they came.
Import it
import { sortHand } from "@johnmorrisdotca/kumimoji";
Definition
function sortHand(play: TilePlay): TilePlay
Parameters
| Name | Type | Description |
|---|---|---|
play | TilePlay | The current immutable solo-game progress. |
Returns
TilePlay
The hand in order (John, 2026-09-28: "it gets sorted for letters alphabetically"): English A to Z, Japanese あいうえお, which is the order of the kana's tile codes, and the wilds last as they came.
Examples
import { deal, sortHand } from "@johnmorrisdotca/kumimoji";
const play = deal("catdog",3);
console.log(sortHand(play).hand);[ 'a', 'c', 't' ]What it prints (run when this page was built)