Open mchirico opened 3 years ago
mchirico, Thanks for opening this issue!
I did this :/
package main
import ( "fmt" "sync" "time" )
type MF struct { l int sync.Mutex }
func (mf *MF) mfmt(txt string, timeSleep int) { mf.Mutex.Lock() defer mf.Mutex.Unlock()
for i := 0; i < mf.l; i++ {
fmt.Printf("\b") // backspace
}
mf.l = len(txt)
fmt.Printf("%s", txt)
time.Sleep(time.Duration(timeSleep) * time.Millisecond)
}
func main() {
fmt.Println("Moon Phases")
msg := []string{"○", "◔", "◑", "◕", "●"}
m := &MF{}
for i := 0; i < 100; i++ {
for _, v := range msg {
m.mfmt(v, 50)
}
}
}
You come up with a program...