Reference · Rolls and exact odds
isFairfunction
Whether a roll is of plain fair dice and nothing else: no loaded die, and no custom die either, whose faces are whatever somebody made them. A site that wants only honest standard dice refuses anything this is false for.
Import it
import { isFair } from "@johnmorrisdotca/korokoro";
Definition
function isFair(spec: RollSpec): boolean
Parameters
| Name | Type | Description |
|---|---|---|
spec | RollSpec | Dice counts, sides, rules and modifier; omitted fields use the documented defaults. |
Returns
boolean
Whether a roll is of plain fair dice and nothing else: no loaded die, and no custom die either, whose faces are whatever somebody made them. A site that wants only honest standard dice refuses anything this is false for.
Examples
import { isFair } from "@johnmorrisdotca/korokoro";
import { parseNotation } from "@johnmorrisdotca/korokoro";
console.log(isFair(parseNotation("1d6{6:3}")!));falseWhat it prints (run when this page was built)