Reference · Tiles, layouts and deals
matchClassfunction
THE MATCHING RULE. Two identical tiles match; under the usual rule a flower matches any flower and a season any season, since there is only one of each.
Import it
import { matchClass } from "@johnmorrisdotca/jarajara";
Definition
function matchClass(code: string, rule: MahjongBonusRule): string
Parameters
| Name | Type | Description |
|---|---|---|
code | string | The one-character face code or tile identifier. |
rule | MahjongBonusRule | Grouped or identical bonus matching. |
Returns
string
THE MATCHING RULE. Two identical tiles match; under the usual rule a flower matches any flower and a season any season, since there is only one of each.
Examples
import { matchClass } from "@johnmorrisdotca/jarajara";
console.log(matchClass("I","group"));flowersWhat it prints (run when this page was built)