Reference · Tiles, Mexican Train and replay
Traintype
A train on the table: the tiles laid on it in order, and whether its owner's marker says anybody may play on it.
Import it
import type { Train } from "@johnmorrisdotca/domino";
Definition
type Train = {
laid: readonly LaidDomino[];
open: boolean;
};
Members
| Name | Type | Description |
|---|---|---|
laid | readonly number[] | |
open | boolean | Open to everybody: the Mexican Train always, a player's own once they could not play. |
Examples
import { startTrain } from "@johnmorrisdotca/domino";
import type { Train } from "@johnmorrisdotca/domino";
const game = startTrain(9,["A","B"],42,{length:"short",doubles:"one",mexican:"any"},[false,true])!;
const value: Train = game.trains[0];
console.log(value);{ laid: [], open: false }What it prints (run when this page was built)