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

sortEuchrefunction

A hand sorted as a player holds it: by suit (trumps last once made), high cards to the right.

Import it

import { sortEuchre } from "@johnmorrisdotca/toranpu/euchre";

Definition

function sortEuchre(hand: readonly CardId[], trump?: CardSuit | null): CardId[]

Parameters

NameTypeDescription
handreadonly string[]

The player’s held cards, or the hand number for a deal.

trump (optional)CardSuit | null

The current trump suit.

Returns

string[]

A hand sorted as a player holds it: by suit (trumps last once made), high cards to the right.

Examples

import { sortEuchre } from "@johnmorrisdotca/toranpu/euchre";

console.log(sortEuchre(["JD", "AH", "9C"], "H"));
[ '9C', 'AH', 'JD' ]

What it prints (run when this page was built)

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