Skip to the content

Dominoドミノ

Deal seeded dominoes, play Mexican Train with native rules and computers, and replay a saved game.

Domino is the Japanese borrowed word ドミノ for dominoes. About the name

Contents

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

NameTypeDescription
laidreadonly number[]
openboolean

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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/domino 1.1.4.