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 · Games and state

choicesfunction

Every way of choosing count of these cards, in the order they are given.

Import it

import { choices } from "@johnmorrisdotca/toranpu";

Definition

function choices<T>(items: readonly T[], count: number): T[][]

Parameters

NameTypeDescription
itemsreadonly T[]

The items to shuffle without changing the input.

countnumber

The requested number of cards, sounds or layout positions.

Returns

T[][]

Every way of choosing count of these cards, in the order they are given.

Examples

import { choices } from "@johnmorrisdotca/toranpu";

console.log(choices([1, 2, 3], 2));
[ [ 1, 2 ], [ 1, 3 ], [ 2, 3 ] ]

What it prints (run when this page was built)

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