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

freshDeckfunction

A fresh deck in the order a new pack is sorted: spades ace to king, then hearts, diamonds, clubs.

Import it

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

Definition

function freshDeck(): Card[]

Returns

Card[]

A fresh deck in the order a new pack is sorted: spades ace to king, then hearts, diamonds, clubs.

Examples

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

console.log(freshDeck().slice(0, 4));
[
  { suit: 'spades', rank: 1 },
  { suit: 'spades', rank: 2 },
  { suit: 'spades', rank: 3 },
  { suit: 'spades', rank: 4 }
]

What it prints (run when this page was built)

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