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

laidAgainstfunction

The tile laid against end: turned so that end touches, the other one left open.

Import it

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

Definition

function laidAgainst(tile: Domino, end: number): LaidDomino

Parameters

NameTypeDescription
tilenumber

A canonical tile number: low * 16 + high.

endnumber

The pip value the next laid tile must match.

Returns

number

The tile laid against end: turned so that end touches, the other one left open.

Examples

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

console.log(laidAgainst(tileOf(6,4),6));
100

What it prints (run when this page was built)

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