diff --git a/Coin/Coin.go b/Coin/Coin.go index 4dc7414..a8e6cfa 100644 --- a/Coin/Coin.go +++ b/Coin/Coin.go @@ -4,11 +4,13 @@ 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 diff --git a/Dice/Dice.go b/Dice/Dice.go index c116ed1..7451d05 100644 --- a/Dice/Dice.go +++ b/Dice/Dice.go @@ -4,6 +4,7 @@ import ( "fmt" "math/rand" "strings" + "time" "gitlab.com/EternalWanderer/dice-roller/Colors" ) @@ -13,6 +14,7 @@ var ( ) func Cast(surfaces, diceThrows, modifier int) { + rand.Seed(time.Now().Unix()) var ( casts []int cast, total int diff --git a/main.go b/main.go index 54b5651..3ddb91f 100644 --- a/main.go +++ b/main.go @@ -3,9 +3,7 @@ package main import ( "flag" "fmt" - "math/rand" "os" - "time" "gitlab.com/EternalWanderer/dice-roller/Coin" "gitlab.com/EternalWanderer/dice-roller/Colors" @@ -18,7 +16,6 @@ var ( ) func main() { - rand.Seed(time.Now().Unix()) ParseFlags() switch {