Created
October 20, 2015 15:53
-
-
Save siakaramalegos/adcc668e1cfc5fee8d3d to your computer and use it in GitHub Desktop.
Activity app showing branches and methods
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
todays_temp = 80 | |
weather_condition = "sunny" | |
def activity(temp, condition="sunny") | |
if temp == 80 && condition == "sunny" | |
puts "That's the perfect temp! Let's still go hiking." | |
elsif temp > 50 && condition == "sunny" | |
puts "I'm going hiking!" | |
else | |
puts "Let's read a book." | |
end # ends if | |
end # ends method | |
activity(todays_temp) | |
activity(70) | |
activity(40) | |
activity(70, "rainy") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment