Reference · Rolls and exact odds
DiceWarOptionstype
What a game of Dice War is set up with. Everything but the players is optional.
Import it
import type { DiceWarOptions } from "@johnmorrisdotca/korokoro";
Definition
type DiceWarOptions = {
players: readonly string[];
computers?: readonly boolean[];
dice?: number;
sides?: number;
goal?: DiceWarGoal;
to?: number;
seed?: string;
};
Members
| Name | Type | Description |
|---|---|---|
players | readonly string[] | One name a seat. Two to eight. |
computers (optional) | readonly boolean[] | undefined | One a seat: true where a computer rolls. A seat not given is a person's, whose dice are handed in. |
dice (optional) | number | undefined | How many dice each player rolls, added up: 1 unless said, up to |
sides (optional) | number | undefined | How many sides each die has, 2 to 1000: 6 unless said. |
goal (optional) | DiceWarGoal | undefined |
|
to (optional) | number | undefined | The score to play to, or the number of rounds: 5 unless said. |
seed (optional) | string | undefined | The seed the computers' dice come from, any text: a fresh one unless said. |
Examples
import type { DiceWarOptions } from "@johnmorrisdotca/korokoro";
const value: DiceWarOptions = { players: ["One", "Two"], computers: [true, true], seed: "docs" };
console.log(value.players.length);2What it prints (run when this page was built)