weightedroulette

package
v1.4.81 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomChoice

func RandomChoice(r *rand.Rand, outcomes ...Outcome)

RandomChoice executes one of the outcomes randomly, according to the weights.

Types

type Outcome

type Outcome struct {
	Weight int
	Event  func()
}

Outcome holds a possible outcome of roulette random choice execution.

Jump to

Keyboard shortcuts

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