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

sortOhHellfunction

A hand as a player holds it: by suit, trumps last, high cards to the right.

Import it

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

Definition

function sortOhHell(hand: readonly CardId[], trump: string): CardId[]

Parameters

NameTypeDescription
handreadonly string[]

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

trumpstring

The current trump suit.

Returns

string[]

A hand as a player holds it: by suit, trumps last, high cards to the right.

Examples

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

console.log(sortOhHell(["AS", "KH", "2C"], "S"));
[ 'KH', '2C', 'AS' ]

What it prints (run when this page was built)

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