Moved rng from main

This commit is contained in:
Nox Sluijtman 2022-08-19 10:52:53 +02:00
parent b4e0356ef5
commit 82ca0401e6
3 changed files with 4 additions and 3 deletions

View file

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

View file

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

View file

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