Skip to content

Instantly share code, notes, and snippets.

@aeschright
Last active December 2, 2017 23:21
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 aeschright/9ec5c7574e53f36cbd3221894e24b3a1 to your computer and use it in GitHub Desktop.
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 ["happy", "delighted", "gratified", "glad", "joyful", "joyous", "pleased", "satisfied", "thankful", "tickled"].include? mood_description
emoji = happy_emojis.sample
elsif ["sad", "bad", "blue", "brokenhearted", "cast down", "crestfallen", "dejected", "depressed", "despondent", "disconsolate", "doleful", "down", "downcast", "downhearted", "droopy", "forlorn", "gloomy", "glum", "hangdog", "heartbroken", "heartsick", "heartsore", "heavyhearted", "inconsolable", "joyless", "low", "low-spirited", "melancholic", "melancholy", "miserable", "mournful", "saddened", "sorrowful", "sorry", "unhappy", "woebegone", "woeful", "wretched"].include? mood_description
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
File.open('moods.txt', 'a') do |file|
file.puts "#{Time.now} #{emoji}"
end
puts "I recorded your answer."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment