Reference · Rolls and exact odds
diceWarSpecfunction
The dice a game rolls, as a spec the rest of the package reads.
Import it
import { diceWarSpec } from "@johnmorrisdotca/korokoro";
Definition
function diceWarSpec(game: Pick<DiceWarGame, "dice" | "sides">): RollSpec
Parameters
| Name | Type | Description |
|---|---|---|
game | Pick<DiceWarGame, "dice" | "sides"> | The current Dice War state. |
Returns
RollSpec
The dice a game rolls, as a spec the rest of the package reads.
Examples
import { diceWarSpec } from "@johnmorrisdotca/korokoro";
import { formatNotation, startDiceWar } from "@johnmorrisdotca/korokoro";
const game = startDiceWar({ players: ["One", "Two"], computers: [true, true], goal: "rounds", to: 1, seed: "table" })!;
console.log(formatNotation(diceWarSpec(game)));1d6What it prints (run when this page was built)