Created
December 17, 2012 22:07
-
-
Save MelanieS/4322766 to your computer and use it in GitHub Desktop.
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
if rocks > pebbles | |
puts "You have more rocks than pebbles." | |
elsif rocks < pebbles | |
puts "You have more pebbles than rocks." | |
end | |
if rocks > pebbles | |
puts "You have more rocks than pebbles." | |
elsif pebbles > rocks | |
puts "You have more pebbles than rocks." | |
end |
I like fruit better. Who wants to eat gravel? sol ;-)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I like the ternary operator.
But really there is one operator that matches the situation perfectly, and that is the equality operator, AKA the spaceship operator.