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 · Card designs

faceNamefunction

A face's name in words: "queen of spades", "red joker"; in Japanese "スペードのクイーン", "赤のジョーカー". A card of a design of the page's own, given as design, is named by that design's label, or by its id.

Import it

import { faceName } from "@johnmorrisdotca/toranpu/card-faces";

Definition

function faceName(card: string, language?: Language, design?: CardDesign): string

Parameters

NameTypeDescription
cardstring

The physical card or card id to read, draw or play.

language (optional)Language

English or Japanese for the displayed words.

design (optional)CardDesign | undefined

The card-face design or registered design name.

Returns

string

A face's name in words: "queen of spades", "red joker"; in Japanese "スペードのクイーン", "赤のジョーカー". A card of a design of the page's own, given as design, is named by that design's label, or by its id.

Examples

import { faceName } from "@johnmorrisdotca/toranpu/card-faces";

console.log(faceName("AS", "en"));
ace of spades

What it prints (run when this page was built)

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