mirror of
https://gitlab.com/EternalWanderer/dice-roller.git
synced 2024-11-29 05:13:50 +01:00
Moved rng from main
This commit is contained in:
parent
b4e0356ef5
commit
82ca0401e6
|
@ -4,11 +4,13 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"gitlab.com/EternalWanderer/dice-roller/Colors"
|
"gitlab.com/EternalWanderer/dice-roller/Colors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Toss(castAmount int) {
|
func Toss(castAmount int) {
|
||||||
|
rand.Seed(time.Now().Unix())
|
||||||
var (
|
var (
|
||||||
coins []string
|
coins []string
|
||||||
coin string
|
coin string
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"gitlab.com/EternalWanderer/dice-roller/Colors"
|
"gitlab.com/EternalWanderer/dice-roller/Colors"
|
||||||
)
|
)
|
||||||
|
@ -13,6 +14,7 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
func Cast(surfaces, diceThrows, modifier int) {
|
func Cast(surfaces, diceThrows, modifier int) {
|
||||||
|
rand.Seed(time.Now().Unix())
|
||||||
var (
|
var (
|
||||||
casts []int
|
casts []int
|
||||||
cast, total int
|
cast, total int
|
||||||
|
|
3
main.go
3
main.go
|
@ -3,9 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
|
||||||
"os"
|
"os"
|
||||||
"time"
|
|
||||||
|
|
||||||
"gitlab.com/EternalWanderer/dice-roller/Coin"
|
"gitlab.com/EternalWanderer/dice-roller/Coin"
|
||||||
"gitlab.com/EternalWanderer/dice-roller/Colors"
|
"gitlab.com/EternalWanderer/dice-roller/Colors"
|
||||||
|
@ -18,7 +16,6 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
rand.Seed(time.Now().Unix())
|
|
||||||
ParseFlags()
|
ParseFlags()
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
|
|
Loading…
Reference in a new issue