package
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: Jan 31, 2024
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
Documentation
¶
Rand returns range in [0~n)
package main
import (
"fmt"
"github.com/giant-stone/go/grand"
)
func main() {
fmt.Println(grand.Rand(10))
fmt.Println(grand.Rand(3))
}
Output:
func RandRange ¶
added in
v0.0.16
func RandRange(min, max int) int
Rand returns range in [min~max]
package main
import (
"fmt"
"github.com/giant-stone/go/grand"
)
func main() {
fmt.Println(grand.RandRange(1_000, 9_999))
fmt.Println(grand.RandRange(100_0000, 999_9999))
}
Output:
Source Files
¶
Click to show internal directories.
Click to hide internal directories.