本文へ移動

Jarajaraジャラジャラ

麻雀牌を描き、手牌や積み重ねた盤を配置し、シード付きの「合わせ」をひとりでも対戦卓でも遊べます。

「ジャラジャラ」は麻雀牌が触れ合う音を表す言葉です。 名前について(英語)

目次

リファレンス · 牌・配置・配り方

setPairs関数

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

EVERY PAIR THE SET HOLDS, 72 of them: each ordinary face twice (four copies), and the eight bonus tiles as four pairs — two flowers and two seasons, split at random under the usual rule, or four faces drawn twice each under the Identical rule. random decides the splits; the order is the set's, and the deal shuffles it.

sets is how many sets a mega layout is dealt (2 for 288 tiles, 4 for 576), 1 unless said, and a deal of one set is exactly what it has always been. More sets are each set's pairs again, with one difference under the usual rule: a flower or a season is dealt once, since a deal that held one twice would be read as the Identical rule (bonusRuleOf). The bonus pairs a further set would have held are four more pairs of ordinary faces, drawn at random, so the tile count is the same.

インポート

import { setPairs } from "@johnmorrisdotca/jarajara";

定義

function setPairs(rule: MahjongBonusRule, random: () => number, sets?: number): [string, string][]

引数

名前型説明
ruleMahjongBonusRule

Grouped or identical bonus matching.

random() => number

A reproducible random source returning values in [0,1).

sets (省略可)number

The number of complete physical tile sets.

戻り値

[string, string][]

EVERY PAIR THE SET HOLDS, 72 of them: each ordinary face twice (four copies), and the eight bonus tiles as four pairs — two flowers and two seasons, split at random under the usual rule, or four faces drawn twice each under the Identical rule. random decides the splits; the order is the set's, and the deal shuffles it.

例

import { seededRandom, setPairs } from "@johnmorrisdotca/jarajara";

console.log(setPairs("group",seededRandom(42)).length);
72

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

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

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