Moved rng back to main

This commit is contained in:
Nox Sluijtman 2022-08-19 12:04:04 +02:00
parent a43117c270
commit bed2f3df01
3 changed files with 3 additions and 9 deletions

View file

@ -4,13 +4,11 @@ import (
"fmt"
"math/rand"
"strings"
"time"
"gitlab.com/EternalWanderer/dice-roller/Colors"
)
func Toss(castAmount int) {
rand.Seed(time.Now().Unix())
var (
coins []string
coin string

View file

@ -4,7 +4,6 @@ import (
"fmt"
"math/rand"
"strings"
"time"
"gitlab.com/EternalWanderer/dice-roller/Colors"
)
@ -13,12 +12,7 @@ var (
surfaces, diceThrows, modidier int
)
func genSeed() {
rand.Seed(time.Now().Unix())
}
func Cast(surfaces, diceThrows, modifier int) {
genSeed()
var (
casts []int
cast, total int
@ -52,7 +46,6 @@ func Cast(surfaces, diceThrows, modifier int) {
}
func SimpleCast(modifier int) int {
genSeed()
var cast = rand.Intn(20) + 1

View file

@ -3,7 +3,9 @@ package main
import (
"flag"
"fmt"
"math/rand"
"os"
"time"
"gitlab.com/EternalWanderer/dice-roller/Coin"
"gitlab.com/EternalWanderer/dice-roller/Colors"
@ -17,6 +19,7 @@ var (
func main() {
ParseFlags()
rand.Seed(time.Now().Unix())
switch {