Skip to content

Instantly share code, notes, and snippets.

@aeschright
Last active December 2, 2017 23:21
Show Gist options
  • Select an option

  • Save aeschright/9ec5c7574e53f36cbd3221894e24b3a1 to your computer and use it in GitHub Desktop.

Select an option

Save aeschright/9ec5c7574e53f36cbd3221894e24b3a1 to your computer and use it in GitHub Desktop.
Emoji mood tracker
#!/usr/bin/env ruby
happy_emojis = ["πŸ˜€", "πŸ˜ƒ", "😺", "😸"]
sad_emojis = ["πŸ˜”", "πŸ™", "πŸ™", "☹️", "😿"]
mood_satisfied = false
puts "How are you feeling?"
mood_description = gets.chomp
while mood_satisfied == false do
if mood_description == "happy"
emoji = happy_emojis.sample
elsif mood_description == "sad"
emoji = sad_emojis.sample
end
puts "Does #{emoji} match your mood?"
confirmation = gets.chomp
confirmation = confirmation.downcase
if ["y", "yes", "yep", "sure"].include? confirmation
mood_satisfied = true
else
puts "Please give me another word to describe your mood"
mood_description = gets.chomp
end
end
puts "I recorded your answer."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment