Created
December 27, 2012 08:09
-
-
Save blairanderson/4386477 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
(1..100).each do |each| | |
if each % 3 == 0 and each % 5 == 0 | |
puts "FizzBuzz" | |
elsif each % 3 == 0 | |
puts "Fizz" | |
elsif each % 5 == 0 | |
puts "Buzz" | |
else | |
puts each | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The variable name
each
kind of suggests the wrong thing. It's like saying:By naming the variable
all
I'm making it sound like we're checking all the ages every time.