util

package
v0.0.0-...-79eae96 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reverse

func Reverse(data sort.Interface)

func Scramble

func Scramble(r Randomer, data sort.Interface)

func ScrambleN

func ScrambleN(r Randomer, data sort.Interface, n int)

Types

type Interval

type Interval struct {
	Min, Max int // [Min ... Max-1]
}

func Ivl

func Ivl(min, max int) Interval

func (Interval) Contains

func (i Interval) Contains(x int) bool

func (Interval) Empty

func (i Interval) Empty() bool

func (Interval) Equal

func (a Interval) Equal(b Interval) bool

func (Interval) Len

func (i Interval) Len() int

Length is less or equal of zero if an interval is empty.

func (Interval) Middle

func (i Interval) Middle() int

func (Interval) Split

func (a Interval) Split(n int) []Interval

type Randomer

type Randomer interface {
	Intn(n int) int // 0 <= x < n
}

func RandomerSeed

func RandomerSeed(seed int64) Randomer

func RandomerTime

func RandomerTime(t time.Time) Randomer

func RandomerTimeNow

func RandomerTimeNow() Randomer

Jump to

Keyboard shortcuts

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