mirror of
https://github.com/Threnklyn/advent-of-code-go.git
synced 2026-06-07 12:45:10 +02:00
!changed mathutil package to mathy, removed int/string casting from mathy
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user