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 · Deck tools

CardCodetype

A card as ONE character, A–Z then a–z (cardCode): a whole deck is a fifty-two-character string, so a deal travels in a saved game, an address and a move list without any separator to parse.

Import it

import type { CardCode } from "@johnmorrisdotca/toranpu/deck";

Definition

type CardCode = string;

Examples

import type { CardCode } from "@johnmorrisdotca/toranpu/deck";
import { cardCode } from "@johnmorrisdotca/toranpu/deck";

const value: CardCode = cardCode({ suit: "spades", rank: 1 });
console.log(value);
A

What it prints (run when this page was built)

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