Skip to content

Instantly share code, notes, and snippets.

@arkiver
Created November 1, 2012 10:48
Show Gist options
  • Save arkiver/3993013 to your computer and use it in GitHub Desktop.
Save arkiver/3993013 to your computer and use it in GitHub Desktop.
fizz buzz in ruby
#!/usr/bin/ENV ruby1.9.3
i = 0
100.times do
i += 1
if i%5 == 0 && i%3 ==0 then
print "fizz buzz"
elsif i%3 == 0 then
print "fizz"
elsif i%5 == 0 then
print "buzz"
else
print i
end
sleep 0.2
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment