Reference · Tiles, layouts and deals
groupStartsfunction
The places in a list, already in order, where a new group starts: every place whose tile is of another suit (or kind) than the one before it.
Import it
import { groupStarts } from "@johnmorrisdotca/jarajara";
Definition
function groupStarts(codes: readonly string[], by?: TileGrouping): number[]
Parameters
| Name | Type | Description |
|---|---|---|
codes | readonly string[] | The tile face codes in current order. |
by (optional) | TileGrouping | The native grouping mode. |
Returns
number[]
The places in a list, already in order, where a new group starts: every place whose tile is of another suit (or kind) than the one before it.
Examples
import { groupStarts } from "@johnmorrisdotca/jarajara";
console.log(groupStarts(["a","b","F"],"suit"));[ 2 ]What it prints (run when this page was built)