Created
November 6, 2011 12:49
-
-
Save yusuiked/1342828 to your computer and use it in GitHub Desktop.
FibBuzz in Groovy
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
println((1..100).inject([1G,1G]){fib,i->fib<<fib[i]+fib[i-1]}.collect{it%15==0?"FizzBuzz":it%3==0?"Fizz":it%5==0?"Buzz":it}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment