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

endsOffunction

A tile's two ends, the smaller first.

Import it

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

Definition

function endsOf(tile: Domino): [number, number]

Parameters

NameTypeDescription
tilenumber

A canonical tile number: low * 16 + high.

Returns

[number, number]

A tile's two ends, the smaller first.

Examples

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

console.log(endsOf(tileOf(6,4)));
[ 4, 6 ]

What it prints (run when this page was built)

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