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 · Shared Awase table

takeAtTablefunction

The table after the player to move takes this pair, or null where the rules do not allow it.

Import it

import { takeAtTable } from "@johnmorrisdotca/jarajara/table";

Definition

function takeAtTable(table: AwaseTable, a: number, b: number): AwaseTable | null

Parameters

NameTypeDescription
tableAwaseTable

The shared native table and its recorded pair takes.

anumber

The first tile slot or code specified by this signature.

bnumber

The second tile slot or code specified by this signature.

Returns

AwaseTable | null

The table after the player to move takes this pair, or null where the rules do not allow it.

Examples

import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { freePairs, geometryOf, layoutFor } from "@johnmorrisdotca/jarajara";
import { startTable, takeAtTable } from "@johnmorrisdotca/jarajara/table";

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 table = startTable(deal,[{name:"Seat 1"},{name:"Seat 2"}]);
console.log(takeAtTable(table,pair[0],pair[1])?.takes.length);
1

What it prints (run when this page was built)

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