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
| Name | Type | Description |
|---|---|---|
items | readonly T[] | The items to shuffle without changing the input. |
count | number | 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)