wantedfunction
Whether the discard would go straight into a meld: the hand with it and its best throw has less deadwood than now.
Import it
import { wanted } from "@johnmorrisdotca/toranpu/gin-rummy";
Definition
function wanted(hand: readonly CardId[], card: CardId): boolean
Parameters
| Name | Type | Description |
|---|---|---|
hand | readonly string[] | The player’s held cards, or the hand number for a deal. |
card | string | The physical card or card id to read, draw or play. |
Returns
boolean
Whether the discard would go straight into a meld: the hand with it and its best throw has less deadwood than now.
Examples
import { wanted } from "@johnmorrisdotca/toranpu/gin-rummy";
console.log(wanted(["3H", "4H"], "5H"));falseWhat it prints (run when this page was built)