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

SUIT_DISPLAYconstant

How each suit is written and drawn: its symbol, its name and its colour.

Import it

import { SUIT_DISPLAY } from "@johnmorrisdotca/toranpu/deck";

Definition

const SUIT_DISPLAY: Record<Suit, SuitDisplay> = {
    spades: { symbol: "♠", name: "spades", colour: "black" },
    hearts: { symbol: "♥", name: "hearts", colour: "red" },
    diamonds: { symbol: "♦", name: "diamonds", colour: "red" },
    clubs: { symbol: "♣", name: "clubs", colour: "black" },
}

Members

NameTypeDescription
spadesSuitDisplay
heartsSuitDisplay
diamondsSuitDisplay
clubsSuitDisplay

Examples

import { SUIT_DISPLAY } from "@johnmorrisdotca/toranpu/deck";
console.log(SUIT_DISPLAY);
{
  spades: { symbol: '♠', name: 'spades', colour: 'black' },
  hearts: { symbol: '♥', name: 'hearts', colour: 'red' },
  diamonds: { symbol: '♦', name: 'diamonds', colour: 'red' },
  clubs: { symbol: '♣', name: 'clubs', colour: 'black' }
}

What it prints (run when this page was built)

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