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

tileWordsfunction

A tile as a person reads it: "6–4", the larger end first, as a tile is named at the table.

Import it

import { tileWords } from "@johnmorrisdotca/domino";

Definition

function tileWords(tile: Domino): string

Parameters

NameTypeDescription
tilenumber

A canonical tile number: low * 16 + high.

Returns

string

A tile as a person reads it: "6–4", the larger end first, as a tile is named at the table.

Examples

import { tileOf, tileWords } from "@johnmorrisdotca/domino";

console.log(tileWords(tileOf(6,4)));
6–4

What it prints (run when this page was built)

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