aboutsummaryrefslogtreecommitdiff
path: root/logic/dices.go
diff options
context:
space:
mode:
Diffstat (limited to 'logic/dices.go')
-rw-r--r--logic/dices.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/logic/dices.go b/logic/dices.go
index 43dca22..bab1248 100644
--- a/logic/dices.go
+++ b/logic/dices.go
@@ -8,6 +8,12 @@ import (
)
var diceRunes = [7]string{"", "\u2680", "\u2681", "\u2682", "\u2683", "\u2684", "\u2685"}
+var fancy = false
+
+func SetFancyPrint(f bool) {
+ fancy = f
+}
+
type Dices [5]int
@@ -28,7 +34,11 @@ func (d *Dices) Roll(i []int) error {
func (d Dices) String() string {
s := ""
for _, v := range d {
- s += diceRunes[v] + " "
+ if fancy {
+ s += diceRunes[v] + " "
+ } else {
+ s += fmt.Sprintf("%d ", v)
+ }
}
return fmt.Sprintf("%s", s)
}