1
0
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:
v2ray
2016-01-21 22:45:44 +01:00
parent d623b1809d
commit 37a9d8ef50
6 changed files with 23 additions and 36 deletions

12
common/dice/dice.go Normal file
View File

@@ -0,0 +1,12 @@
package dice
import (
"math/rand"
)
func Roll(n int) int {
if n == 1 {
return 0
}
return rand.Intn(n)
}