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
引数
| 名前 | 型 | 説明 |
|---|---|---|
sides | Sides | A numbered die size or F for Fate dice. |
weights | unknown | 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 ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。