v2ray-core/common/dice/dice.go

18 lines
167 B
Go

package dice
import (
"math/rand"
"time"
)
func Roll(n int) int {
if n == 1 {
return 0
}
return rand.Intn(n)
}
func init() {
rand.Seed(time.Now().Unix())
}