Skip to content

Instantly share code, notes, and snippets.

@chhhris
Created June 10, 2013 22:40
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 chhhris/5753065 to your computer and use it in GitHub Desktop.
Save chhhris/5753065 to your computer and use it in GitHub Desktop.
# Temperature bot is comfortable when it's room temperature (18-21C). Help him out by completing the method below:
def temperature_bot(temp)
case temp
when 18..21
"I like this temperature"
else
"This is uncomfortable for me"
end
end
# temperature_bot(18)
#=> "I like this temperature"
# temperature_bot(21)
#=> "I like this temperature"
#temperature_bot(22)
#=> "This is uncomfortable for me"
#temperature_bot(-3)
#=> "This is uncomfortable for me"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment