Skip to the content

Jarajaraジャラジャラ

Draw mahjong tiles, arrange racks and stacked boards, and play seeded Awase alone or at a shared table.

Jarajara is the Japanese sound of mahjong tiles rattling together. About the name

Contents

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

NameTypeDescription
layoutMahjongLayout

The native stacked tile positions.

cellsstring

The face-code string in native slot order; dot marks a removed tile.

ruleMahjongBonusRule

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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/jarajara 1.7.0.