diff options
| -rw-r--r-- | logic/dices.go (renamed from goffel/dices.go) | 5 | ||||
| -rw-r--r-- | logic/dices_test.go (renamed from goffel/dices_test.go) | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/goffel/dices.go b/logic/dices.go index 113ccb0..07c4a98 100644 --- a/goffel/dices.go +++ b/logic/dices.go @@ -1,4 +1,4 @@ -package goffel +package logic import ( "fmt" @@ -11,6 +11,9 @@ var diceRunes = [7]string{"", "\u2680", "\u2681", "\u2682", "\u2683", "\u2684", type Dices [5]int func (d *Dices) Roll(i []int) { + if i == nil { + i = []int{1,2,3,4,5} + } for _, v := range i { d[v-1] = rand.Int()%6 + 1 } diff --git a/goffel/dices_test.go b/logic/dices_test.go index 4593fac..a18ecca 100644 --- a/goffel/dices_test.go +++ b/logic/dices_test.go @@ -1,4 +1,4 @@ -package goffel +package logic import "testing" |
