dice

package
v0.15.17-hotfix.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL