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

runClifunction

Run the command line. See domino --help for what it takes. One seed serves the whole run, so the same command prints the same lines on every machine.

Import it

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

Definition

function runCli(args: readonly string[], around?: CliSurroundings): CliResult

Parameters

NameTypeDescription
argsreadonly string[]

Command-line arguments without the executable name.

around (optional)CliSurroundings

Optional environment, input, locale and seed source for the pure CLI.

Returns

CliResult

Output and error strings with exit code 0 for success, 1 for refused input, or 2 for invalid command usage.

Examples

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

console.log(runCli(["deal","--seed","42","--players","2","--set","9"],{locale:"en-US"}).code);
0

What it prints (run when this page was built)

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