Created
November 1, 2012 10:48
-
-
Save arkiver/3993013 to your computer and use it in GitHub Desktop.
fizz buzz in ruby
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
#!/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