Last active
August 29, 2015 13:55
-
-
Save jamescookie/8721903 to your computer and use it in GitHub Desktop.
Obfuscated fizzbuzz 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
def l=_=1,t,u,v;char p,e,d,a,r=y=100;_=++l++;r-=l;_*=++l;a=r+(l*_)+1;p=y-l+--_;(e,d)=[p+l,a+_];t=/$d$d/;u=''+p+e+t;v=''+r+a+t;for(O in 1..y){println((1>(O%_)&&(O%l)>0)?u:(1>(O%l)&&1>(O%_))?u+v:(1>(O%l)&&(O%_)>0)?v:O)} | |
//or in as few characters as possible: | |
//for(i in 1..100){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