diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2017-01-27 18:19:28 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2017-01-27 18:19:28 +0100 |
| commit | 62f66bd55084a2300196be07b11098dbd1fc3c9e (patch) | |
| tree | 14bd8feac76f0536538af4606df40fdbba99725f | |
| parent | 713547fcba74294cef18ad573f1cb9a93e3b6795 (diff) | |
| download | goffel-62f66bd55084a2300196be07b11098dbd1fc3c9e.tar.gz goffel-62f66bd55084a2300196be07b11098dbd1fc3c9e.zip | |
change package goffel into logic
| -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" |
