Reference · Rolls and exact odds
valueOfFacefunction
What a face of a group's die is worth in a total: its number, or for a custom face its value, which is 0 when it is only words.
Import it
import { valueOfFace } from "@johnmorrisdotca/korokoro";
Definition
function valueOfFace(group: DiceGroup, face: number): number
Parameters
| Name | Type | Description |
|---|---|---|
group | DiceGroup | One kind of dice and its rules. |
face | number | The physical face value to display or read. |
Returns
number
What a face of a group's die is worth in a total: its number, or for a custom face its value, which is 0 when it is only words.
Examples
import { valueOfFace } from "@johnmorrisdotca/korokoro";
import { normalizeSpec } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
console.log(valueOfFace(spec, 4));4What it prints (run when this page was built)