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

dealAllfunction

Deal the whole deck round the table: the first hands get one more where it does not divide evenly.

Import it

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

Definition

function dealAll(deck: readonly Card[], hands: number): Card[][]

Parameters

NameTypeDescription
deckreadonly Card[]

The deck in its current order; the input is left unchanged.

handsnumber

The hands by seat, or the number of hands where numeric.

Returns

Card[][]

Deal the whole deck round the table: the first hands get one more where it does not divide evenly.

Examples

import { dealAll, shuffledDeck } from "@johnmorrisdotca/toranpu/deck";

console.log(dealAll(shuffledDeck(42), 4).map((hand) => hand.length));
[ 13, 13, 13, 13 ]

What it prints (run when this page was built)

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