Reference · Tiles, layouts and deals
describeSlotfunction
Where a slot is, in tiles: across and down from the layout's corner (halves where a tile sits between two), and which layer, from 1.
Import it
import { describeSlot } from "@johnmorrisdotca/jarajara";
Definition
function describeSlot(layout: MahjongLayout, index: number): { x: number; y: number; z: number; } | null
Parameters
| Name | Type | Description |
|---|---|---|
layout | MahjongLayout | The native stacked tile positions. |
index | number | The shuffle count or slot index specified by the signature. |
Returns
{ x: number; y: number; z: number; } | null
The slot’s tile coordinates and one-based layer, or null for an out-of-range slot index.
Examples
import { describeSlot, layoutFor } from "@johnmorrisdotca/jarajara";
const layout = layoutFor(4)!;
console.log(describeSlot(layout,0));{ x: 0, y: 0, z: 1 }What it prints (run when this page was built)