Created
April 18, 2015 18:16
-
-
Save bchase/636bcc18fa7c04c01ce5 to your computer and use it in GitHub Desktop.
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
i = 5 | |
x = [:Fizz][i%3] # => :Fizz || nil | |
# 5%3 | |
# [:Fizz][2] # => nil | |
str = "%sBuzz" % x # => 'Buzz' || 'FizzBuzz' | |
# "%sBuzz" % nil # => 'Buzz' | |
str = [str][i%5] # => ^ above str or nil | |
# 5%5 | |
# ['Buzz'][0] # => 'Buzz' | |
# | |
# str || x || i # "(Fizz)?Buzz" || "Fizz" || i | |
# 'Buzz' || nil || 5 | |
str || x || i # => 'Buzz' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment