Skip to content

Instantly share code, notes, and snippets.

@mattn
Created June 3, 2014 01:42
Show Gist options
  • Save mattn/3514e18f9d0f98c400fb to your computer and use it in GitHub Desktop.
Save mattn/3514e18f9d0f98c400fb to your computer and use it in GitHub Desktop.
package main
import (
"math/rand"
"fmt"
"strings"
)
var words = []string {
"ボ",
"ン",
"ジョ",
"ヴィ",
}
func main() {
bonjovi := make(chan string)
go func() {
for {
bonjovi <- words[rand.Int() % len(words)]
}
}()
items := make([]string, 6)
count := 1
for jovi := range bonjovi {
items = append(items[1:], jovi)
if strings.Join(items, "") == "ジョンボンジョヴィ" {
break
}
fmt.Print(strings.Join(items, "") + "・")
count++
}
fmt.Printf(`
%d Bon Jovis
_人人人人人人人人人人人人人人_
> You Give Love A Bad Name <
 ̄Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y ̄
`, count)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment