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 · Hearts

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

NameTypeDescription
trickreadonly 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" }]));
1

What it prints (run when this page was built)

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