trickWinnerfunction
Who takes a finished trick: the highest card of the suit led.
Import it
import { trickWinner } from "@johnmorrisdotca/toranpu/hearts";
Definition
function trickWinner(trick: readonly HeartsPlay[]): number
Parameters
| Name | Type | Description |
|---|---|---|
trick | readonly HeartsPlay[] | The cards and seats in the current trick. |
Returns
number
Who takes a finished trick: the highest card of the suit led.
Examples
import { trickWinner } from "@johnmorrisdotca/toranpu/hearts";
console.log(trickWinner([{ seat: 0, card: "2C" }, { seat: 1, card: "AC" }, { seat: 2, card: "KH" }, { seat: 3, card: "QC" }]));1What it prints (run when this page was built)