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

mayRerollUntilfunction

Whether a die may be rerolled until it clears this face: the reroll must match the lowest face and no more than half of them.

Import it

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

Definition

function mayRerollUntil(sides: Sides, reroll: unknown): reroll is number

Parameters

NameTypeDescription
sidesSides

A numbered die size or F for Fate dice.

rerollunknown

The highest face eligible for a reroll.

Returns

boolean

Whether a die may be rerolled until it clears this face: the reroll must match the lowest face and no more than half of them.

Examples

import { mayRerollUntil } from "@johnmorrisdotca/korokoro";
console.log(mayRerollUntil(6, 2), mayRerollUntil(6, 4));
true false

What it prints (run when this page was built)

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