shuffledDeckfunction
A deck shuffled from a seed: the same seed, the same order, in every browser and every test.
Import it
import { shuffledDeck } from "@johnmorrisdotca/toranpu/deck";
Definition
function shuffledDeck(seed: number): Card[]
Parameters
| Name | Type | Description |
|---|---|---|
seed | number | The numeric seed that reproduces the same shuffle or deal. |
Returns
Card[]
A deck shuffled from a seed: the same seed, the same order, in every browser and every test.
Examples
import { shuffledDeck } from "@johnmorrisdotca/toranpu/deck";
console.log(shuffledDeck(42).slice(0, 7));[
{ suit: 'clubs', rank: 3 },
{ suit: 'clubs', rank: 9 },
{ suit: 'hearts', rank: 2 },
{ suit: 'hearts', rank: 13 },
{ suit: 'clubs', rank: 13 },
{ suit: 'diamonds', rank: 9 },
{ suit: 'spades', rank: 7 }
]What it prints (run when this page was built)