Added number generation to each function

This commit is contained in:
Nox Sluijtman 2022-08-19 12:01:07 +02:00
parent 4372285f13
commit a43117c270

View file

@ -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