本文へ移動

Dominoドミノ

シード付きでドミノを配り、標準のルールとコンピューターでメキシカントレインを遊び、保存したゲームを再生します。

「ドミノ」は、英語の domino をそのまま日本語に取り入れた言葉です。 名前について(英語)

目次

リファレンス · 牌・メキシカントレイン・再生

handSizeFor関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

HOW MANY TILES EACH PLAYER IS DEALT, by the set and the number at the table. Double-twelve's are the figures most published rules give (fifteen each for two to four, twelve for five or six, ten for seven or eight); the other sets are scaled so that at every table some tiles are left to draw.

インポート

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

定義

function handSizeFor(set: number, players: number): number

引数

名前型説明
setnumber

The highest double of the supported set: 9, 12 or 15.

playersnumber

Player count, or names in seat order, as specified by this signature.

戻り値

number

HOW MANY TILES EACH PLAYER IS DEALT, by the set and the number at the table. Double-twelve's are the figures most published rules give (fifteen each for two to four, twelve for five or six, ten for seven or eight); the other sets are scaled so that at every table some tiles are left to draw.

例

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

console.log(handSizeFor(9,2));
10

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/domino 1.1.4 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。