Created
December 1, 2015 16:43
-
-
Save NickyBobby/b44042c0eb5895266111 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
| 0.upto 1000 do |x| | |
| if x%3==0 && x%5==0 && x%7==0 | |
| puts "SuperFizzBuzz" | |
| elsif x%3==0 && x%7==0 | |
| puts "SuperFizz" | |
| elsif x%5==0 && x%7==0 | |
| puts "SuperBuzz" | |
| elsif x%3==0 | |
| puts "Fizz" | |
| elsif x%5==0 | |
| puts "Buzz" | |
| elsif x%7==0 | |
| puts "Super" | |
| else | |
| puts x | |
| end | |
| end | |
| for i in 0..1000 | |
| puts i%3==0 ? i%5==0 ? i%7==0 ? "SuperFizzBuzz" : "FizzBuzz" : "Fizz" : i%5==0 && i%7==0 ? "SuperBuzz" : i%3==0 && i%7==0 ? "SuperFizz" : i%5==0 ? "Buzz" : i%7==0 ? "Super" : i | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment