mirror of
https://github.com/Threnklyn/advent-of-code-go.git
synced 2026-05-19 03:23:27 +02:00
14 lines
225 B
Go
14 lines
225 B
Go
package algos
|
|
|
|
import (
|
|
"math/rand"
|
|
"time"
|
|
)
|
|
|
|
var rn = rand.New(rand.NewSource(time.Now().UnixNano()))
|
|
|
|
// RandomInt returns a random int from zero through upper - 1
|
|
func RandomInt(upper int) int {
|
|
return rn.Intn(upper)
|
|
}
|