weightedroulette

package
v0.0.0-...-ab10b8b Latest Latest
Warning

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

Go to latest
Published: Sep 5, 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