Skip to the content

Toranpuトランプ

Use a deck, play eleven games with computers, solve a solitaire, or display cards in your own design.

Toranpu is Japanese for playing cards. About the name

Contents

Reference · Euchre

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

NameTypeDescription
trickreadonly EuchrePlay[]

The cards and seats in the current trick.

trumpCardSuit

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"));
1

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/toranpu 2.15.0.