Reference · Tiles, layouts and deals
Replayedtype
Where a solve stands after its moves: the tiles, and how many shuffles it has had.
Import it
import type { Replayed } from "@johnmorrisdotca/jarajara";
Definition
type Replayed = {
cells: MahjongCells;
shuffles: number;
};
Members
| Name | Type | Description |
|---|---|---|
cells | string | |
shuffles | number |
Examples
import { generateAwase } from "@johnmorrisdotca/jarajara/awase";
import { freePairs, geometryOf, layoutFor, playSolve } from "@johnmorrisdotca/jarajara";
import type { Replayed } 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];
const value: Replayed = playSolve(4,cells,[{pair}],"group")!;
console.log(value);{ cells: 'xPNx.BB.', shuffles: 0 }What it prints (run when this page was built)