Last active
December 23, 2015 18:49
-
-
Save featherart/6678157 to your computer and use it in GitHub Desktop.
conditionals lab
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
# in irb, evaluate the following: | |
4 < 5 | |
4 == 5 # note the == is different from = | |
4 != 5 | |
1 <= 2 | |
0 > 1 | |
1 > 1 | |
1 >= 1 | |
blue = true | |
red = false | |
blue || red | |
blue && blue | |
red && red | |
red && blue | |
red || blue || (4 == 5) | |
blue && (1 >= 1) && (9 != 10) | |
# If all that was too easy, please try this: | |
# Suddenly you find yourself in the negative utopia | |
# that is 1984! Write a code snippet to give a result if | |
# 2 + 2 == 5 and another result if that does not evaluate to true | |
if # your code here | |
else | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment