diff options
| author | Nikolaus Gotsche <n@softwarefools.com> | 2018-10-23 11:43:26 +0200 |
|---|---|---|
| committer | Nikolaus Gotsche <n@softwarefools.com> | 2018-10-23 11:43:26 +0200 |
| commit | 3bbc28806f43c323b21d9053a9e25c89614d5f60 (patch) | |
| tree | 58765389496b737cfc50f07f408ca17ff9388b89 /utils.go | |
| parent | 404386194b9492b29b03d4e1e65558c545a70b51 (diff) | |
Frames and Timedebug0.3.2
Diffstat (limited to 'utils.go')
| -rw-r--r-- | utils.go | 35 |
1 files changed, 28 insertions, 7 deletions
@@ -10,17 +10,38 @@ import ( "strconv" "strings" "unicode/utf8" + "math/rand" + "time" ) const ( framewidth int = 40 - li = "\u2501" - mli = "\u2501\u252f\u2501\u2501" //Masterline -T- - sli = " \u251c\u2500 " //Slave Line L_ - nli = " \u2502 " //noone Line | - fli = " \u2515\u2501\u2501" //Footer Line L + li string = "\u2500" + mli string = "\u2500\u2530\u2500\u2500" //Masterline -T- + sli string = " \u2520\u2500 " //Slave Line L_ + nli string = " \u2503 " //noone Line | + fli string = " \u2516\u2500\u2500" //Footer Line L ) +var positive = [...]string {"Done","Accomplished","Finished","Congrats","Completed"} +var negative = [...]string {"Failed","Try Again","Sorry","Not Quite Yet","Incomplete"} + +func posR() (out string){ + s1 := rand.NewSource(time.Now().UnixNano()) + r1 := rand.New(s1) + n := r1.Intn(len(positive)) + out = positive[n] + return +} + +func negR() (out string){ + s1 := rand.NewSource(time.Now().UnixNano()) + r1 := rand.New(s1) + n := r1.Intn(len(negative)) + out = negative[n] + return +} + func frame(text string, head bool) (out string) { if head { out = mli + text @@ -36,8 +57,8 @@ func frame(text string, head bool) (out string) { } if head { out = "\n" + out - }else{ - out = out + "\n" + //}else{ + // out = out + "\n" } return } |
