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

keptCountfunction

How many dice of one group count towards the total. For a roll of several kinds, ask each of groupsOf.

Import it

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

Definition

function keptCount(group: DiceGroup): number

Parameters

NameTypeDescription
groupDiceGroup

One kind of dice and its rules.

Returns

number

How many dice of one group count towards the total. For a roll of several kinds, ask each of groupsOf.

Examples

import { keptCount } from "@johnmorrisdotca/korokoro";
import { parseNotation } from "@johnmorrisdotca/korokoro";
console.log(keptCount(parseNotation("4d6kh3")!));
3

What it prints (run when this page was built)

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