aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2017-02-13 16:47:50 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2017-02-13 16:47:50 +0100
commit640de962f91d90d37cba804acba6b570092b49dc (patch)
tree0394670b8d5a95d50d1550cf0d4a19c5d3d82edf
parent23b75df0c9176d3c5dd39246283e45ad014928d8 (diff)
downloadgoffel-640de962f91d90d37cba804acba6b570092b49dc.tar.gz
goffel-640de962f91d90d37cba804acba6b570092b49dc.zip
dices: add NewDices()
-rw-r--r--logic/dices.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/logic/dices.go b/logic/dices.go
index 5c0deba..d6a8952 100644
--- a/logic/dices.go
+++ b/logic/dices.go
@@ -19,6 +19,12 @@ func SetFancyPrint(f bool) {
type Dices [5]int
+func NewDices() Dices {
+ d := Dices{}
+ d.Roll(nil)
+ return d
+}
+
func (d *Dices) Roll(i []int) error {
if i == nil || len(i) == 0 {
i = []int{1, 2, 3, 4, 5}