1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 18:17:52 -05:00
v2fly/common/dice/dice.go
2016-01-25 10:47:22 +00:00

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())
}