Skip to content

Instantly share code, notes, and snippets.

@a-suenami
Created July 22, 2015 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-suenami/36310dff9630b9bbbbe3 to your computer and use it in GitHub Desktop.
Save a-suenami/36310dff9630b9bbbbe3 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"time"
"math/rand"
)
func main() {
n := 1000
kusaChars := []rune{ 'w', 'W', 'v' }
for i := 0; i < n; i ++ {
fmt.Printf("%c", choice(kusaChars))
}
fmt.Println()
}
func choice(s []rune) rune {
rand.Seed(time.Now().UnixNano())
i := rand.Intn(len(s))
return s[i]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment