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

sidesOffunction

The kind of die one die of a roll is.

Import it

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

Definition

function sidesOf(spec: RollSpec, die: DieRoll): Sides

Parameters

NameTypeDescription
specRollSpec

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

dieDieRoll

The logged die whose group is requested.

Returns

Sides

The kind of die one die of a roll is.

Examples

import { sidesOf } 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(sidesOf(spec, diceOf(sample)[0]!));
6

What it prints (run when this page was built)

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