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][]
引数
| 名前 | 型 | 説明 |
|---|---|---|
rule | MahjongBonusRule | 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出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。