Created
October 13, 2011 11:37
-
-
Save urokuta/1284026 to your computer and use it in GitHub Desktop.
fizz buzz
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
num = ARGV[0] | |
1.upto(num.to_i) {|i| | |
if i % 3 == 0 && i % 5 == 0 then | |
puts "fizzbuzz" | |
elsif i%3 == 0 then | |
puts "fizz" | |
elsif i%5 == 0 then | |
puts "buzz" | |
else | |
puts i | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment