Created
February 17, 2017 05:51
-
-
Save brunkb/bd67e5517e1ee3a89ca892091725ab4d to your computer and use it in GitHub Desktop.
My version of FizzBuzz in Groovy (Console)
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
1.upto(100, { i -> println "${i % 3 ? '' : 'Fizz'}${i % 5 ? '' : 'Buzz'}" ?: i }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I submitted this one years ago to Rosetta Code as an improvement over the one that was featured there. It is still on there as of 2019.