Skip to content

Instantly share code, notes, and snippets.

@sprintingdev
Last active August 29, 2015 13:58
Show Gist options
  • Save sprintingdev/10391136 to your computer and use it in GitHub Desktop.
Save sprintingdev/10391136 to your computer and use it in GitHub Desktop.
The Standard Fizz Buzz program in Groovy
def fizz = "fizz"
def buzz = "buzz"
(1..100).collect {Integer i ->
String s = "";
s += i%3==0?fizz:""
s += i%5==0?buzz:""
return s?:i
}.join("\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment