Created
April 6, 2011 12:02
-
-
Save djgraham/905535 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 1.upto(100) do |i| | |
| string = "" | |
| string+= "Fizz" if i % 3 == 0 | |
| string+= "Buzz" if i % 5 == 0 | |
| string+= i.to_s if string.empty? | |
| puts string | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment