Skip to content

Instantly share code, notes, and snippets.

@kzisme
Created December 14, 2015 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kzisme/d235dd89aaa5305a6346 to your computer and use it in GitHub Desktop.
Save kzisme/d235dd89aaa5305a6346 to your computer and use it in GitHub Desktop.
Random js fun stuff
#"Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”."
a=b=!![]+![],a--,c=b+b;while(++a)e=!(a%(c+c+b)),alert(!(a%(c+b))?e?"FizzBuzz":"Fizz":e?"Buzz":a);
#Or.....
$=~[];$={___:++$,$$$$:(![]+"")[$],__$:++$,$_$_:(![]+"")[$],_$_:++$,$_$$:({}+"")[$],$$_$:($[$]+"")[$],_$$:++$,$$$_:(!""+"")[$],$__:++$,$_$:++$,$$__:({}+"")[$],$$_:++$,$$$:++$,$___:++$,$__$:++$};$.$_=($.$_=$+"")[$.$_$]+($._$=$.$_[$.__$])+($.$$=($.$+"")[$.__$])+((!$)+"")[$._$$]+($.__=$.$_[$.$$_])+($.$=(!""+"")[$.__$])+($._=(!""+"")[$._$_])+$.$_[$.$_$]+$.__+$._$+$.$;$.$$=$.$+(!""+"")[$._$$]+$.__+$._+$.$+$.$$;$.$=($.___)[$.$_][$.$_];$.$($.$($.$$+"\""+$.$$$$+$._$+"\\"+$.__$+$.$$_+$._$_+"\\"+$.$__+$.___+"(\\"+$.__$+$.$$_+$.$$_+$.$_$_+"\\"+$.__$+$.$$_+$._$_+"\\"+$.$__+$.___+"\\"+$.__$+$.$_$+$.__$+"="+$.__$+";\\"+$.$__+$.___+"\\"+$.__$+$.$_$+$.__$+"\\"+$.$__+$.___+"<=\\"+$.$__+$.___+$.__$+$.___+$.___+";\\"+$.$__+$.___+"\\"+$.__$+$.$_$+$.__$+"++)\\"+$.__$+$._$_+"{\\"+$.__$+$._$_+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.__$+$.$_$+$.__$+$.$$$$+"\\"+$.$__+$.___+"(\\"+$.__$+$.$_$+$.__$+"\\"+$.$__+$.___+"%\\"+$.$__+$.___+$.__$+$.$_$+"\\"+$.$__+$.___+"==\\"+$.$__+$.___+$.___+")\\"+$.__$+$._$_+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+$.$$__+$._$+"\\"+$.__$+$.$_$+$.$$_+"\\"+$.__$+$.$$_+$._$$+$._$+(![]+"")[$._$_]+$.$$$_+"."+(![]+"")[$._$_]+$._$+"\\"+$.__$+$.$__+$.$$$+"(\\\"\\"+$.__$+$.___+$.$$_+"\\"+$.__$+$.$_$+$.__$+"\\"+$.__$+$.$$$+$._$_+"\\"+$.__$+$.$$$+$._$_+"\\"+$.__$+$.___+$._$_+$._+"\\"+$.__$+$.$$$+$._$_+"\\"+$.__$+$.$$$+$._$_+"\\\");\\"+$.__$+$._$_+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+$.$$$_+(![]+"")[$._$_]+"\\"+$.__$+$.$$_+$._$$+$.$$$_+"\\"+$.$__+$.___+"\\"+$.__$+$.$_$+$.__$+$.$$$$+"\\"+$.$__+$.___+"(\\"+$.__$+$.$_$+$.__$+"\\"+$.$__+$.___+"%\\"+$.$__+$.___+$._$$+"\\"+$.$__+$.___+"==\\"+$.$__+$.___+$.___+")\\"+$.__$+$._$_+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+$.$$__+$._$+"\\"+$.__$+$.$_$+$.$$_+"\\"+$.__$+$.$$_+$._$$+$._$+(![]+"")[$._$_]+$.$$$_+"."+(![]+"")[$._$_]+$._$+"\\"+$.__$+$.$__+$.$$$+"(\\\"\\"+$.__$+$.___+$.$$_+"\\"+$.__$+$.$_$+$.__$+"\\"+$.__$+$.$$$+$._$_+"\\"+$.__$+$.$$$+$._$_+"\\\");\\"+$.__$+$._$_+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+$.$$$_+(![]+"")[$._$_]+"\\"+$.__$+$.$$_+$._$$+$.$$$_+"\\"+$.$__+$.___+"\\"+$.__$+$.$_$+$.__$+$.$$$$+"\\"+$.$__+$.___+"(\\"+$.__$+$.$_$+$.__$+"\\"+$.$__+$.___+"%\\"+$.$__+$.___+$.$_$+"\\"+$.$__+$.___+"==\\"+$.$__+$.___+$.___+")\\"+$.__$+$._$_+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+$.$$__+$._$+"\\"+$.__$+$.$_$+$.$$_+"\\"+$.__$+$.$$_+$._$$+$._$+(![]+"")[$._$_]+$.$$$_+"."+(![]+"")[$._$_]+$._$+"\\"+$.__$+$.$__+$.$$$+"(\\\"\\"+$.__$+$.___+$._$_+$._+"\\"+$.__$+$.$$$+$._$_+"\\"+$.__$+$.$$$+$._$_+"\\\");\\"+$.__$+$._$_+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+$.$$$_+(![]+"")[$._$_]+"\\"+$.__$+$.$$_+$._$$+$.$$$_+"\\"+$.__$+$._$_+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+"\\"+$.$__+$.___+$.$$__+$._$+"\\"+$.__$+$.$_$+$.$$_+"\\"+$.__$+$.$$_+$._$$+$._$+(![]+"")[$._$_]+$.$$$_+"."+(![]+"")[$._$_]+$._$+"\\"+$.__$+$.$__+$.$$$+"(\\"+$.__$+$.$_$+$.__$+");\\"+$.__$+$._$_+"}"+"\"")())();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment