master
Jordan Orelli 10 years ago
parent 4925a1f0d4
commit a7912f388b

@ -67,6 +67,9 @@ func (w wordBag) lengths() []int {
func (w wordBag) randomWordN(n int) string { func (w wordBag) randomWordN(n int) string {
words, ok := w[n] words, ok := w[n]
if ok { if ok {
if len(words) == 1 {
return words[0]
}
return words[rand.Intn(len(words)-1)] return words[rand.Intn(len(words)-1)]
} }
return "" return ""

Loading…
Cancel
Save