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

handPipsfunction

The pips in a hand, which count against its holder when the round ends.

Import it

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

Definition

function handPips(hand: readonly Domino[]): number

Parameters

NameTypeDescription
handreadonly number[]

The canonical tile numbers in one hand.

Returns

number

The pips in a hand, which count against its holder when the round ends.

Examples

import { handPips, startTrain } from "@johnmorrisdotca/domino";

const game = startTrain(9,["A","B"],42,{length:"short",doubles:"one",mexican:"any"},[false,true])!;
console.log(handPips(game.hands[0]));
107

What it prints (run when this page was built)

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