Skip to content

Instantly share code, notes, and snippets.

@soramugi
Created June 11, 2012 17:24
Show Gist options
  • Save soramugi/2911428 to your computer and use it in GitHub Desktop.
Save soramugi/2911428 to your computer and use it in GitHub Desktop.
fizzbuzz
#!/usr/bin/ruby
1.upto(100) do |i|
p = i
if i % 3 == 0 then
p = "Fizz"
end
if i % 5 == 0 then
p = "Buzz"
end
if i % 15 == 0 then
p = "FizzBuzz"
end
print p, ", "
end
print "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment