Switch to go in order to use tcell

This commit is contained in:
Zachary Yedidia
2016-03-17 17:27:57 -04:00
parent e9e25d0c85
commit 1781766e21
16 changed files with 587 additions and 678 deletions

27
util.go Normal file
View File

@@ -0,0 +1,27 @@
package main
import (
"unicode/utf8"
)
func count(s string) int {
return utf8.RuneCountInString(s)
}
func numOccurences(s string, c byte) int {
var n int
for i := 0; i < len(s); i++ {
if s[i] == c {
n++
}
}
return n
}
func emptyString(n int) string {
var str string
for i := 0; i < n; i++ {
str += " "
}
return str
}