Reference · Rolls and exact odds
toTextfunction
Rolls as plain text, one to a line, each with its time in UTC, oldest first as given.
Import it
import { toText } from "@johnmorrisdotca/korokoro";
Definition
function toText(rolls: readonly Roll[]): string
Parameters
| Name | Type | Description |
|---|---|---|
rolls | readonly Roll[] | Completed rolls, or the number of attempts where this parameter is numeric. |
Returns
string
Rolls as plain text, one to a line, each with its time in UTC, oldest first as given.
Examples
import { toText } 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(toText([sample]));1970-01-01T00:00:00.000Z 2d6: 7 [2 5]What it prints (run when this page was built)