spadesTrickWinnerfunction
Who takes a finished trick (or is winning one still being played): the highest spade, or else the highest card of the suit led.
Import it
import { spadesTrickWinner } from "@johnmorrisdotca/toranpu/spades";
Definition
function spadesTrickWinner(trick: readonly SpadesPlay[]): number
Parameters
| Name | Type | Description |
|---|---|---|
trick | readonly SpadesPlay[] | The cards and seats in the current trick. |
Returns
number
Who takes a finished trick (or is winning one still being played): the highest spade, or else the highest card of the suit led.
Examples
import { spadesTrickWinner } from "@johnmorrisdotca/toranpu/spades";
console.log(spadesTrickWinner([{ seat: 0, card: "AC" }, { seat: 1, card: "2S" }, { seat: 2, card: "KC" }, { seat: 3, card: "QC" }]));1What it prints (run when this page was built)