Reference · Shared Awase table
AwaseTableStatetype
Where a game at the table stands, read from its pairs.
Import it
import type { AwaseTableState } from "@johnmorrisdotca/jarajara/table";
Definition
type AwaseTableState = {
cells: string;
turn: number;
scores: number[];
pairs: number[];
taken: AwaseTake[];
shuffles: number;
shuffledAfter: number | null;
over: boolean;
winners: number[];
};
Members
| Name | Type | Description |
|---|---|---|
cells | string | The tiles as they lie now. |
turn | number | The seat to move; meaningless once |
scores | number[] | Points, and pairs taken, seat by seat. |
pairs | number[] | |
taken | AwaseTake[] | |
shuffles | number | How many times the table ran out of pairs and the tiles were shuffled; and after which take the last was. |
shuffledAfter | number | null | |
over | boolean | Over: every tile taken, or the tiles left could not be freed by any shuffle. |
winners | number[] | The seats with the most points, once it is over: one, or several sharing it. |
Examples
import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { readTable, startTable } from "@johnmorrisdotca/jarajara/table";
import type { AwaseTableState } from "@johnmorrisdotca/jarajara/table";
const deal = generateAwase(4,"easy",2026);
const table = startTable(deal,[{name:"Seat 1"},{name:"Seat 2"}]);
const state = readTable(table)!;
const value: AwaseTableState = state;
console.log(value);{
cells: 'xPNxDBBD',
turn: 0,
scores: [ 0, 0 ],
pairs: [ 0, 0 ],
taken: [],
shuffles: 0,
shuffledAfter: null,
over: false,
winners: []
}What it prints (run when this page was built)