Created
March 31, 2019 22:24
-
-
Save itskaia/199a4296726ce7d50a447a14e3ed11a1 to your computer and use it in GitHub Desktop.
Do The Things
This file contains hidden or 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
activities_I_do = [ | |
"climb", | |
"study", | |
"read", | |
"text mom", | |
"email dad", | |
"socialize IRL" | |
] | |
score_card = [] | |
activity_slot = 0 | |
while true | |
puts "Did you #{activities_I_do[activity_slot]} today? [y/n]" | |
activity_slot = activity_slot + 1 | |
activity_done = $stdin.gets.chomp | |
if activity_done == 'y' || activity_done == 'Y' | |
score_card.push(1) | |
end | |
score_card_total = score_card.reduce{|x,y|x+y} | |
if activity_slot >= 6 | |
puts "Daily score: #{score_card_total}" | |
break | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment