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

waysToShutfunction

Every way to make a total from different numbers 1 to 9, largest first: the tiles a Shut the Box roll may shut.

Import it

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

Definition

function waysToShut(total: number): number[][]

Parameters

NameTypeDescription
totalnumber

The total to measure or compare.

Returns

number[][]

Every way to make a total from different numbers 1 to 9, largest first: the tiles a Shut the Box roll may shut.

Examples

import { waysToShut } from "@johnmorrisdotca/korokoro";
console.log(waysToShut(7));
[ [ 7 ], [ 6, 1 ], [ 5, 2 ], [ 4, 3 ], [ 4, 2, 1 ] ]

What it prints (run when this page was built)

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