Skip to content

Instantly share code, notes, and snippets.

@fumokmm
Created May 17, 2012 15:49
Show Gist options
  • Select an option

  • Save fumokmm/2719724 to your computer and use it in GitHub Desktop.

Select an option

Save fumokmm/2719724 to your computer and use it in GitHub Desktop.
Groovyで変なFizzBuzz書いた
a={n,s->['']*n+s}
f={n->[0..n,a(3,'fizz')*n,a(5,'buzz')*n].transpose().collect{i,f,b->[f,b].any()?f+b:i}}
f(100).drop(1).each{println(it)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment