Skip to content

Instantly share code, notes, and snippets.

@KyonLi
Created April 1, 2019 07:56
Show Gist options
  • Save KyonLi/3f98e155473c4ef2743dfddf787f3f0b to your computer and use it in GitHub Desktop.
Save KyonLi/3f98e155473c4ef2743dfddf787f3f0b to your computer and use it in GitHub Desktop.
Coin in go
func coin() {
backspace := "\b\b"
for i := 0; i < 5; i++ {
for _, c := range []string{"🌝", "πŸŒ–", "πŸŒ—", "🌘", "🌚", "πŸŒ’", "πŸŒ“", "πŸŒ”"} {
fmt.Printf("%s%s", backspace, c)
time.Sleep(33333 * time.Microsecond)
}
}
rand.Seed(int64(time.Now().UnixNano()))
if rand.Uint32() % 2 == 0 {
fmt.Printf("%s🌝\n", backspace)
} else {
fmt.Printf("%s🌚\n", backspace)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment