Reference · Rolls and exact odds
diceWarOddsfunction
The exact odds of one throw of Dice War among players players, from the package's own odds for the dice: the chance the
throw is settled at once and the chance of war, and, for a total you name, how it fares against everybody else's.
Worked out from the totals' exact odds, never simulated.
Import it
import { diceWarOdds } from "@johnmorrisdotca/korokoro";
Definition
function diceWarOdds(options: { players: number; dice?: number; sides?: number; }, total?: number): DiceWarChances
Parameters
| Name | Type | Description |
|---|---|---|
options | { players: number; dice?: number; sides?: number; } | Options for this call; omitted fields keep their documented defaults. |
total (optional) | number | undefined | The total to measure or compare. |
Returns
DiceWarChances
The exact odds of one throw of Dice War among players players, from the package's own odds for the dice: the chance the throw is settled at once and the chance of war, and, for a total you name, how it fares against everybody else's. Worked out from the totals' exact odds, never simulated.
Examples
import { diceWarOdds } from "@johnmorrisdotca/korokoro";
console.log(diceWarOdds({ players: 2, dice: 1, sides: 6 }).war);0.16666666666666674What it prints (run when this page was built)