Reference · Tile and table elements
hintPairfunction
What a hint is: the free pair that leaves the stacks lowest after it, so a hint never digs a tile deeper than it must.
Import it
import { hintPair } from "@johnmorrisdotca/jarajara/element";
Definition
function hintPair(layout: MahjongLayout, cells: string, rule: MahjongBonusRule): [number, number] | null
Parameters
| Name | Type | Description |
|---|---|---|
layout | MahjongLayout | The native stacked tile positions. |
cells | string | The face-code string in native slot order; dot marks a removed tile. |
rule | MahjongBonusRule | Grouped or identical bonus matching. |
Returns
[number, number] | null
The preferred legal free pair, or null when no matching free pair exists.
Examples
import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { layoutFor } from "@johnmorrisdotca/jarajara";
import { hintPair } from "@johnmorrisdotca/jarajara/element";
const deal = generateAwase(4,"easy",2026);
const layout = layoutFor(4)!;
const cells = deal.givens;
console.log(hintPair(layout,cells,"group"));[ 4, 7 ]What it prints (run when this page was built)