Skip to the content

Korokoroコロコロ

Roll mixed dice or type notation, compare exact probabilities, keep a history and replay seeded rolls.

Korokoro describes something small rolling in Japanese. About the name

Contents

Reference · Rolls and exact odds

loadedWeightsfunction

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 it

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

Definition

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

Parameters

NameTypeDescription
sidesSides

A numbered die size or F for Fate dice.

weightsunknown

One integer weight per physical face.

Returns

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.

Examples

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

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/korokoro 1.16.0.