Reference · Tiles, layouts and deals
groupTilesfunction
The tiles split into the runs a gap is drawn between: by suit or by kind, each run in the set's order.
Import it
import { groupTiles } from "@johnmorrisdotca/jarajara";
Definition
function groupTiles(codes: readonly string[], by?: TileGrouping): string[][]
Parameters
| Name | Type | Description |
|---|---|---|
codes | readonly string[] | The tile face codes in current order. |
by (optional) | TileGrouping | The native grouping mode. |
Returns
string[][]
The tiles split into the runs a gap is drawn between: by suit or by kind, each run in the set's order.
Examples
import { groupTiles } from "@johnmorrisdotca/jarajara";
console.log(groupTiles(["a","b","F"],"suit"));[ [ 'a', 'b' ], [ 'F' ] ]What it prints (run when this page was built)