Documentation ¶ Index ¶ type Dice func NewDice(rate float64) (Dice, error) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Dice ¶ type Dice interface { // Rate returns the sampling rate of this Dice: a number in (0.0, 1.0]. Rate() float64 // Roll returns whether the dice roll succeeded. Roll() bool } Dice is an interface that allows for random sampling. func NewDice ¶ func NewDice(rate float64) (Dice, error) NewDice constructs a new Dice based on a given success rate. Source Files ¶ View all Source files dice.go Click to show internal directories. Click to hide internal directories.