mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-11-13 12:12:59 -08:00
dice.Roll()
This commit is contained in:
1 parent
d623b1809d
commit
37a9d8ef50
6 files changed
+23
-36
No files matched your search
@@ -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