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

playSolvefunction

PLAY THE MOVES ON THE DEAL, refusing the first that the rules do not allow: a pair that is not two free tiles that match, or a shuffle while a pair could still be taken (Shuffle is for when you are stuck), or one that cannot help. Null for a deal or a move that does not read.

Import it

import { playSolve } from "@johnmorrisdotca/jarajara";

Definition

function playSolve(size: number, givens: string, moves: readonly MahjongMove[], rule?: MahjongBonusRule): Replayed | null

Parameters

NameTypeDescription
sizenumber

The native layout size identifier, measured in tiles across.

givensstring

The original face-code deal in native slot order.

movesreadonly MahjongMove[]

The native pair and shuffle moves in chronological order.

rule (optional)MahjongBonusRule

Grouped or identical bonus matching.

Returns

Replayed | null

PLAY THE MOVES ON THE DEAL, refusing the first that the rules do not allow: a pair that is not two free tiles that match, or a shuffle while a pair could still be taken (Shuffle is for when you are stuck), or one that cannot help. null for a deal or a move that does not read.

Examples

import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { freePairs, geometryOf, layoutFor, playSolve } 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];
console.log(playSolve(4,cells,[{pair}],"group")?.cells);
xPNx.BB.

What it prints (run when this page was built)

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