mirror of
https://gitlab.com/EternalWanderer/dice-roller.git
synced 2024-11-29 05:13:50 +01:00
Added number generation to each function
This commit is contained in:
parent
4372285f13
commit
a43117c270
|
@ -13,8 +13,12 @@ var (
|
||||||
surfaces, diceThrows, modidier int
|
surfaces, diceThrows, modidier int
|
||||||
)
|
)
|
||||||
|
|
||||||
func Cast(surfaces, diceThrows, modifier int) {
|
func genSeed() {
|
||||||
rand.Seed(time.Now().Unix())
|
rand.Seed(time.Now().Unix())
|
||||||
|
}
|
||||||
|
|
||||||
|
func Cast(surfaces, diceThrows, modifier int) {
|
||||||
|
genSeed()
|
||||||
var (
|
var (
|
||||||
casts []int
|
casts []int
|
||||||
cast, total int
|
cast, total int
|
||||||
|
@ -48,6 +52,7 @@ func Cast(surfaces, diceThrows, modifier int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func SimpleCast(modifier int) int {
|
func SimpleCast(modifier int) int {
|
||||||
|
genSeed()
|
||||||
|
|
||||||
var cast = rand.Intn(20) + 1
|
var cast = rand.Intn(20) + 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue