mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-01 23:15:21 -05:00
dice.Roll()
This commit is contained in:
12
common/dice/dice.go
Normal file
12
common/dice/dice.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package dice
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
)
|
||||
|
||||
func Roll(n int) int {
|
||||
if n == 1 {
|
||||
return 0
|
||||
}
|
||||
return rand.Intn(n)
|
||||
}
|
||||
Reference in New Issue
Block a user