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 · Tiles, layouts and deals

MatchesOftype

Which tile Find would show for a slot: the ones that could be taken with it now, and the ones that match but are held.

Import it

import type { MatchesOf } from "@johnmorrisdotca/jarajara";

Definition

type MatchesOf = {
    free: number[];
    blocked: number[];
};

Members

NameTypeDescription
freenumber[]

The slots that match the tile and could be taken with it now: both are free. Empty when the tile itself is held.

blockednumber[]

The other slots that match it: held by a tile on top or on both sides (or, when the tile itself is held, every match).

Examples

import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { freePairs, geometryOf, layoutFor, matchesOf } from "@johnmorrisdotca/jarajara";
import type { MatchesOf } from "@johnmorrisdotca/jarajara";

const deal = generateAwase(4,"easy",2026);
const layout = layoutFor(4)!;
const geometry = geometryOf(layout);
const cells = deal.givens;
const pair = freePairs(geometry,cells,"group")[0];
const value: MatchesOf = matchesOf(geometry,cells,"group",pair[0]);
console.log(value);
{ free: [ 7 ], blocked: [] }

What it prints (run when this page was built)

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