mirror of
https://gitlab.com/EternalWanderer/dice-roller.git
synced 2024-11-28 21:03:51 +01:00
Added number generation to each function
This commit is contained in:
parent
4372285f13
commit
a43117c270
|
@ -13,8 +13,12 @@ var (
|
|||
surfaces, diceThrows, modidier int
|
||||
)
|
||||
|
||||
func Cast(surfaces, diceThrows, modifier int) {
|
||||
func genSeed() {
|
||||
rand.Seed(time.Now().Unix())
|
||||
}
|
||||
|
||||
func Cast(surfaces, diceThrows, modifier int) {
|
||||
genSeed()
|
||||
var (
|
||||
casts []int
|
||||
cast, total int
|
||||
|
@ -48,6 +52,7 @@ func Cast(surfaces, diceThrows, modifier int) {
|
|||
}
|
||||
|
||||
func SimpleCast(modifier int) int {
|
||||
genSeed()
|
||||
|
||||
var cast = rand.Intn(20) + 1
|
||||
|
||||
|
|
Loading…
Reference in a new issue