canKnockWithfunction
Whether throwing this card, from a hand of eleven, leaves little enough deadwood to knock with.
Import it
import { canKnockWith } from "@johnmorrisdotca/toranpu/gin-rummy";
Definition
function canKnockWith(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 throwing this card, from a hand of eleven, leaves little enough deadwood to knock with.
Examples
import { canKnockWith } from "@johnmorrisdotca/toranpu/gin-rummy";
console.log(canKnockWith(["3H", "4H", "5H", "7S", "8S", "9S", "8C", "8D", "8H", "AS", "KD"], "KD"));trueWhat it prints (run when this page was built)