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

fitsfunction

Whether a tile has this number at either end, so it can be laid against it.

Import it

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

Definition

function fits(tile: Domino, end: number): boolean

Parameters

NameTypeDescription
tilenumber

A canonical tile number: low * 16 + high.

endnumber

The pip value the next laid tile must match.

Returns

boolean

Whether a tile has this number at either end, so it can be laid against it.

Examples

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

console.log(fits(tileOf(6,4),4));
true

What it prints (run when this page was built)

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