Last active
December 2, 2017 23:21
-
-
Save aeschright/9ec5c7574e53f36cbd3221894e24b3a1 to your computer and use it in GitHub Desktop.
Emoji mood tracker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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