Reference · Tiles, layouts and deals
MAHJONG_FACESconstant
The forty-two tile faces in stable code order, including bonus tiles.
Import it
import { MAHJONG_FACES } from "@johnmorrisdotca/jarajara";
Definition
const MAHJONG_FACES: readonly MahjongFace[] = (() => {
const faces: MahjongFace[] = [];
for (const [suit, ranks] of SUIT_RANKS) {
for (let rank = 1; rank <= ranks; rank += 1)
faces.push({ code: FACE_CODES[faces.length]!, suit, rank });
}
return faces;
})()
Examples
import { MAHJONG_FACES } from "@johnmorrisdotca/jarajara";
console.log(MAHJONG_FACES.length);42What it prints (run when this page was built)