mirror of https://github.com/v2ray/v2ray-core
doc for dice
parent
32b2220739
commit
d89be624ce
|
@ -1,3 +1,6 @@
|
||||||
|
// Package dice contains common functions to generate random number.
|
||||||
|
// It also initialize math/rand with the time in seconds at launch time.
|
||||||
|
|
||||||
package dice
|
package dice
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -5,6 +8,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Roll returns a non-negative number between 0 (inclusive) and n (exclusive).
|
||||||
func Roll(n int) int {
|
func Roll(n int) int {
|
||||||
if n == 1 {
|
if n == 1 {
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Reference in New Issue