Reference · Tiles, layouts and deals
pairsLeftfunction
The tiles left on a layout as pairs that match, each pair's tiles together: what a shuffle lays again.
Import it
import { pairsLeft } from "@johnmorrisdotca/jarajara";
Definition
function pairsLeft(cells: MahjongCells, rule: MahjongBonusRule): [string, string][]
Parameters
| Name | Type | Description |
|---|---|---|
cells | string | The face-code string in native slot order; dot marks a removed tile. |
rule | MahjongBonusRule | Grouped or identical bonus matching. |
Returns
[string, string][]
The tiles left on a layout as pairs that match, each pair's tiles together: what a shuffle lays again.
Examples
import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { pairsLeft } from "@johnmorrisdotca/jarajara";
const deal = generateAwase(4,"easy",2026);
const cells = deal.givens;
console.log(pairsLeft(cells,"group"));[ [ 'B', 'B' ], [ 'D', 'D' ], [ 'N', 'P' ], [ 'x', 'x' ] ]What it prints (run when this page was built)