rnd

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Random

type Random struct {
	// contains filtered or unexported fields
}

Random is a random number generator.

func NewRandom

func NewRandom(seed string) *Random

NewRandom returns a new random number generator using specified seed.

func (*Random) Chance

func (r *Random) Chance(n int) bool

Chance returns true if the specified probability is met.

func (*Random) Pick

func (r *Random) Pick(items []string) string

Pick returns a random element from the specified collection.

func (*Random) PickColors

func (r *Random) PickColors(primary, secondary int) (string, string)

PickColors returns a random color with two differnet shades.

Jump to

Keyboard shortcuts

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