euchreTrickWinnerfunction
Who is taking a trick: the highest trump, or else the highest card of the suit led.
Import it
import { euchreTrickWinner } from "@johnmorrisdotca/toranpu/euchre";
Definition
function euchreTrickWinner(trick: readonly EuchrePlay[], trump: CardSuit): number
Parameters
| Name | Type | Description |
|---|---|---|
trick | readonly EuchrePlay[] | The cards and seats in the current trick. |
trump | CardSuit | The current trump suit. |
Returns
number
Who is taking a trick: the highest trump, or else the highest card of the suit led.
Examples
import { euchreTrickWinner } from "@johnmorrisdotca/toranpu/euchre";
console.log(euchreTrickWinner([{ seat: 0, card: "KH" }, { seat: 1, card: "JD" }, { seat: 2, card: "AH" }, { seat: 3, card: "QC" }], "H"));1What it prints (run when this page was built)