mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-09-11 22:44:22 -04:00
13 lines
112 B
Go
13 lines
112 B
Go
|
package dice
|
||
|
|
||
|
import (
|
||
|
"math/rand"
|
||
|
)
|
||
|
|
||
|
func Roll(n int) int {
|
||
|
if n == 1 {
|
||
|
return 0
|
||
|
}
|
||
|
return rand.Intn(n)
|
||
|
}
|