Reference · Shared Awase table
computerPairfunction
The pair a computer in the seat to move takes, or null when there is nothing to take.
Import it
import { computerPair } from "@johnmorrisdotca/jarajara/table";
Definition
function computerPair(table: AwaseTable, state?: AwaseTableState | null): [number, number] | null
Parameters
| Name | Type | Description |
|---|---|---|
table | AwaseTable | The shared native table and its recorded pair takes. |
state (optional) | AwaseTableState | null | A previously replayed native table state, or null to read it again. |
Returns
[number, number] | null
The pair a computer in the seat to move takes, or null when there is nothing to take.
Examples
import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { computerPair, readTable, startTable } from "@johnmorrisdotca/jarajara/table";
const deal = generateAwase(4,"easy",2026);
const table = startTable(deal,[{name:"Seat 1"},{name:"Seat 2"}]);
const state = readTable(table)!;
console.log(computerPair(table,state));[ 4, 7 ]What it prints (run when this page was built)