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

Cardtype

A card as an object: its suit and its rank.

Import it

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

Definition

type Card = {
    suit: Suit;
    rank: Rank;
};

Members

NameTypeDescription
suitSuit
rankRank

Examples

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

const value: Card = { suit: "spades", rank: 1 };
console.log(cardId(value));
AS

What it prints (run when this page was built)

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