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

groupOffunction

The kind of dice one die of a roll belongs to, with its rules, faces and weights.

Import it

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

Definition

function groupOf(spec: RollSpec, die: DieRoll): DiceGroup

Parameters

NameTypeDescription
specRollSpec

Dice counts, sides, rules and modifier; omitted fields use the documented defaults.

dieDieRoll

The logged die whose group is requested.

Returns

DiceGroup

The kind of dice one die of a roll belongs to, with its rules, faces and weights.

Examples

import { groupOf } from "@johnmorrisdotca/korokoro";
import { diceOf, normalizeSpec, rollFrom } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
const sample = rollFrom(spec, [2, 5], "saved", 0, null)!;
console.log(groupOf(spec, diceOf(sample)[0]!).sides);
6

What it prints (run when this page was built)

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