random

package
v0.0.0-...-a7a3610 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func D10

func D10() int

D10 represents a 10-sided die

func D100

func D100() int

D100 represents a 100-sided die

func D12

func D12() int

D12 represents a 12-sided die

func D2

func D2() int

D2 represents a 2-sided die

func D20

func D20() int

D20 represents a 20-sided die

func D4

func D4() int

D4 represents a 4-sided die

func D6

func D6() int

D6 represents a 6-sided die

func D8

func D8() int

D8 represents a 8-sided die

func Intn

func Intn(max int) int

Intn wraps rand.Intn

func Range

func Range(min, max int) int

Range generates a number between the min and max values provided.

func RollDie

func RollDie(die string) []int

RollDie takes a string value of die, such as '3d20' and returns an int slice with the results.

func SetSource

func SetSource(source rand.Source)

SetSource is used exclusively for testing, it should never be used outside of an _test file. This will allow setting a known generator with a predicatble source of random numbers for test prediction.

Types

This section is empty.

Jump to

Keyboard shortcuts

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