Created
March 22, 2016 14:45
-
-
Save mindplace/e3f4b48ba8d2fbc398ed 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
| def fizzbuzz(max) | |
| (1..max).to_a.each do |num| | |
| current = "" | |
| current << "Fizz" if num % 3 == 0 | |
| current << "Buzz" if num % 5 == 0 | |
| current<< num.to_s if current.empty? | |
| puts current | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment