本文へ移動

Korokoroコロコロ

ダイスを組み合わせて振り、ダイス表記を読み取り、正確な確率を調べます。履歴の保存やシードを指定した再現もできます。

「コロコロ」は、小さなものが転がる様子を表す言葉です。 名前について(英語)

目次

リファレンス · ロールと正確な確率

loadedWeights関数

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

A loaded die's weights, checked and in lowest terms: one whole number from 0 to MAX_WEIGHT for each face, at least two faces that can come up. Undefined when they are not sound, and also when every face weighs the same, which is a fair die and must not be called loaded.

インポート

import { loadedWeights } from "@johnmorrisdotca/korokoro";

定義

function loadedWeights(sides: Sides, weights: unknown): number[] | undefined

引数

名前型説明
sidesSides

A numbered die size or F for Fate dice.

weightsunknown

One integer weight per physical face.

戻り値

number[] | undefined

A loaded die's weights, checked and in lowest terms: one whole number from 0 to MAX_WEIGHT for each face, at least two faces that can come up. undefined when they are not sound, and also when every face weighs the same, which is a fair die and must not be called loaded.

例

import { loadedWeights } from "@johnmorrisdotca/korokoro";
console.log(loadedWeights(6, [1, 1, 1, 1, 1, 3]));
[ 1, 1, 1, 1, 1, 3 ]

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

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

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