sortGinfunction
A hand sorted as a player holds it: by suit (spades, hearts, clubs, diamonds, as the colours alternate), ace low.
Import it
import { sortGin } from "@johnmorrisdotca/toranpu/gin-rummy";
Definition
function sortGin(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: by suit (spades, hearts, clubs, diamonds, as the colours alternate), ace low.
Examples
import { sortGin } from "@johnmorrisdotca/toranpu/gin-rummy";
console.log(sortGin(["KH", "3H", "AS"]));[ 'AS', '3H', 'KH' ]What it prints (run when this page was built)