longestSuitfunction
The suit this hand holds most of, eights aside; clubs first among equals so the choice is always the same.
Import it
import { longestSuit } from "@johnmorrisdotca/toranpu/crazy-eights";
Definition
function longestSuit(hand: readonly CardId[]): CardSuit
Parameters
| Name | Type | Description |
|---|---|---|
hand | readonly string[] | The player’s held cards, or the hand number for a deal. |
Returns
CardSuit
The suit this hand holds most of, eights aside; clubs first among equals so the choice is always the same.
Examples
import { longestSuit } from "@johnmorrisdotca/toranpu/crazy-eights";
console.log(longestSuit(["AS", "2S", "KH"]));SWhat it prints (run when this page was built)