Reference · Tiles, layouts and deals
mixTilesfunction
The same tiles in another order, at random, or the same order for the same seed; never the order they were in unless there is only one to be in.
Import it
import { mixTiles } from "@johnmorrisdotca/jarajara";
Definition
function mixTiles(codes: readonly string[], seed?: number): string[]
Parameters
| Name | Type | Description |
|---|---|---|
codes | readonly string[] | The tile face codes in current order. |
seed (optional) | number | undefined | The numeric seed used to reproduce the deal or its matching rule. |
Returns
string[]
The same tiles in another order, at random, or the same order for the same seed; never the order they were in unless there is only one to be in.
Examples
import { mixTiles } from "@johnmorrisdotca/jarajara";
console.log(mixTiles(["a","b","c"],42));[ 'c', 'a', 'b' ]What it prints (run when this page was built)