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

sortCribbagefunction

A hand sorted as a player holds it: ace low to king, by rank then suit.

Import it

import { sortCribbage } from "@johnmorrisdotca/toranpu/cribbage";

Definition

function sortCribbage(hand: readonly CardId[]): CardId[]

Parameters

NameTypeDescription
handreadonly string[]

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

Returns

string[]

A hand sorted as a player holds it: ace low to king, by rank then suit.

Examples

import { sortCribbage } from "@johnmorrisdotca/toranpu/cribbage";

console.log(sortCribbage(["JS", "5H", "AC"]));
[ 'AC', '5H', 'JS' ]

What it prints (run when this page was built)

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