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

groupsOffunction

The kinds of dice in a roll, in order: the spec's own first, then the rest.

Import it

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

Definition

function groupsOf(spec: RollSpec): DiceGroup[]

Parameters

NameTypeDescription
specRollSpec

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

Returns

DiceGroup[]

The kinds of dice in a roll, in order: the spec's own first, then the rest.

Examples

import { groupsOf } from "@johnmorrisdotca/korokoro";
import { parseNotation } from "@johnmorrisdotca/korokoro";
console.log(groupsOf(parseNotation("1d6+1d8")!).map((group) => group.sides));
[ 6, 8 ]

What it prints (run when this page was built)

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