flipping

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FeelingLucky

func FeelingLucky[T comparable](s []T, coinArg ...*Coin) T

FeelingLucky returns a random item from the given slice.

Types

type Coin

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

func MaybeNewCoin

func MaybeNewCoin(coinArg ...*Coin) *Coin

func NewCoin

func NewCoin(rngArg ...*rand.Rand) *Coin

func (*Coin) Chance

func (c *Coin) Chance(threshold float64) bool

func (*Coin) Flip

func (c *Coin) Flip() bool

func (*Coin) Rng

func (c *Coin) Rng() *rand.Rand

Jump to

Keyboard shortcuts

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