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 · Oh Hell

ohHellTrickWinnerfunction

Who takes a trick: the highest trump, or else the highest card of the suit led.

Import it

import { ohHellTrickWinner } from "@johnmorrisdotca/toranpu/oh-hell";

Definition

function ohHellTrickWinner(trick: readonly OhHellPlay[], trump: string): number

Parameters

NameTypeDescription
trickreadonly OhHellPlay[]

The cards and seats in the current trick.

trumpstring

The current trump suit.

Returns

number

Who takes a trick: the highest trump, or else the highest card of the suit led.

Examples

import { ohHellTrickWinner } from "@johnmorrisdotca/toranpu/oh-hell";

console.log(ohHellTrickWinner([{ seat: 0, card: "AH" }, { seat: 1, card: "KS" }, { seat: 2, card: "TH" }, { seat: 3, card: "QC" }], "S"));
1

What it prints (run when this page was built)

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