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
| Name | Type | Description |
|---|---|---|
table | AwaseTable | The shared native table and its recorded pair takes. |
a | number | The first tile slot or code specified by this signature. |
b | number | 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);1What it prints (run when this page was built)