Reference · Tiles, layouts and deals
bonusRuleOffunction
The deal's rule, read from the deal itself: a bonus tile dealt twice can
only be the Identical rule, since the usual one deals each flower and season
once. A deal holding no bonus tile plays alike under both, and says group.
Import it
import { bonusRuleOf } from "@johnmorrisdotca/jarajara";
Definition
function bonusRuleOf(cells: string): MahjongBonusRule
Parameters
| Name | Type | Description |
|---|---|---|
cells | string | The face-code string in native slot order; dot marks a removed tile. |
Returns
MahjongBonusRule
The deal's rule, read from the deal itself: a bonus tile dealt twice can only be the Identical rule, since the usual one deals each flower and season once. A deal holding no bonus tile plays alike under both, and says group.
Examples
import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { bonusRuleOf } from "@johnmorrisdotca/jarajara";
const deal = generateAwase(4,"easy",2026);
const cells = deal.givens;
console.log(bonusRuleOf(cells));groupWhat it prints (run when this page was built)