G3VRXIVYPNGIVR4IIGSFKG72R3MA4AYMYPJZ5PIR5UICWFLWBFOQC
/*
Package proverb is a "For want of a horseshoe nail, a kingdom was lost" like story generator.
*/
package proverb
import "fmt"
// Proverb should have a comment documenting it.
func Proverb(rhyme []string) (story []string) {
story = make([]string, len(rhyme))
if len(rhyme) == 0 {
return
}
if len(rhyme) > 1 {
for i := 1; i < len(rhyme); i++ {
story[i-1] = fmt.Sprintf("For want of a %s the %s was lost.", rhyme[i-1], rhyme[i])
}
}
story[len(rhyme)-1] = fmt.Sprintf("And all for the want of a %s.", rhyme[0])
return
}