shuffle

package
v0.0.0-...-31898ba Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: ISC Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShuffleMap

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

func Shuffle

func Shuffle(random io.Reader, n int, swap func(i, j int)) *ShuffleMap

Shuffle pseudo-randomizes the order of elements. n is the number of elements. Shuffle panics if n is negative or too large. swap swaps the elements with indexes i and j.

func (*ShuffleMap) Get

func (s *ShuffleMap) Get(index int) int

Jump to

Keyboard shortcuts

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