Created
March 28, 2016 12:20
-
-
Save dncrht/6bb0b49f799678c48bcf to your computer and use it in GitHub Desktop.
my fizzbuzz implementation
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
100.times do |i| | |
out = '' | |
out << 'fizz' if (i%3).zero? | |
out << 'buzz' if (i%5).zero? | |
out << i.to_s if out.empty? | |
puts out | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment