Reference · Rolls and exact odds
setOffunction
What a set of rolls comes to: their sum, the highest and the lowest.
Import it
import { setOf } from "@johnmorrisdotca/korokoro";
Definition
function setOf(rolls: Roll[]): RollSet
Parameters
| Name | Type | Description |
|---|---|---|
rolls | Roll[] | Completed rolls, or the number of attempts where this parameter is numeric. |
Returns
RollSet
What a set of rolls comes to: their sum, the highest and the lowest.
Examples
import { setOf } from "@johnmorrisdotca/korokoro";
import { normalizeSpec, rollFrom } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
const sample = rollFrom(spec, [2, 5], "saved", 0, null)!;
console.log(setOf([sample, sample]).sum);14What it prints (run when this page was built)