Skip to content

Instantly share code, notes, and snippets.

@zachgoldstein
Created June 3, 2018 16:28
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 zachgoldstein/466c45978fe01d9525529dd39278268a to your computer and use it in GitHub Desktop.
Save zachgoldstein/466c45978fe01d9525529dd39278268a to your computer and use it in GitHub Desktop.
sentenceStartMap = map[string]string{
"january": "Way to Go!",
"december": "Magnificent Effort!",
}
var sentenceAdjectiveMap = map[string]string{
"a": "You Rainbow-Infused",
"b": "You Molten",
"c": "You Inspiring",
"z": "You Clever",
}
var sentenceNounMap = map[string]string{
"a": "Echidna!",
"b": "Musk Ox!",
"c": "Land Mermaid",
"y": "Apocalyptic gladiator",
"z": "Genius",
}
sentenceParts := []string{}
sentenceStart, ok := sentenceStartMap[strings.ToLower(month)]
if !ok {
rtm.SendMessage(rtm.NewOutgoingMessage("I Believe in You", ev.Channel))
}
sentenceParts = append(sentenceParts, sentenceStart)
firstNameLetter := strings.ToLower(string(firstName[0]))
sentenceAdjective, ok := sentenceAdjectiveMap[firstNameLetter]
if !ok {
rtm.SendMessage(rtm.NewOutgoingMessage("I Believe in You", ev.Channel))
}
sentenceParts = append(sentenceParts, sentenceAdjective)
lastNameLetter := strings.ToLower(string(lastName[0]))
sentenceNoun, ok := sentenceNounMap[lastNameLetter]
if !ok {
rtm.SendMessage(rtm.NewOutgoingMessage("I Believe in You", ev.Channel))
}
sentenceParts = append(sentenceParts, sentenceNoun)
message := strings.Join(sentenceParts, " ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment