Reference · Rolls and exact odds
playDiceWarfunction
The game after this move, or null for one the rules refuse: the game is over, a person's dice are missing or are not dice of this game, or dice are handed in for a seat that does not roll them.
Import it
import { playDiceWar } from "@johnmorrisdotca/korokoro";
Definition
function playDiceWar(game: DiceWarGame, move: DiceWarMove): DiceWarGame | null
Parameters
| Name | Type | Description |
|---|---|---|
game | DiceWarGame | The current Dice War state. |
move | DiceWarMove | Human faces for the seats that currently roll. |
Returns
DiceWarGame | null
The game after this move, or null for one the rules refuse: the game is over, a person's dice are missing or are not dice of this game, or dice are handed in for a seat that does not roll them.
Examples
import { playDiceWar } from "@johnmorrisdotca/korokoro";
import { startDiceWar } from "@johnmorrisdotca/korokoro";
const game = startDiceWar({ players: ["One", "Two"], computers: [true, true], goal: "rounds", to: 1, seed: "table" })!;
console.log(playDiceWar(game, {})?.round);1What it prints (run when this page was built)