mirror of
https://gitlab.com/EternalWanderer/dice-roller.git
synced 2025-06-08 06:14:25 +02:00
Moved rng back to main
This commit is contained in:
parent
a43117c270
commit
bed2f3df01
3 changed files with 3 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
3
main.go
3
main.go
|
@ -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 {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue