Created
June 3, 2014 01:42
-
-
Save mattn/3514e18f9d0f98c400fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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