Skip to content

Instantly share code, notes, and snippets.

@damianesteban
Created December 6, 2013 23:43
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 damianesteban/7834086 to your computer and use it in GitHub Desktop.
Save damianesteban/7834086 to your computer and use it in GitHub Desktop.
# Week One Exercise One
# Before executing the code given below, guess the results. Next, execute the code.
# Did you get it right? If you did not get it right, can you think of why?
# Discuss your first guess and what you got when running the code. Goal: Understanding
# operator precedence and association.
y = false
z = true
x = y or z
puts x # false
(x = y) or z
puts x # false
x = (y or z)
puts x # true
# I got these all correct on the first try, however I mut admit that I've studied quite a bit
# of boolean arguments in various programming languages so this was pretty easy for me.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment