Skip to content

Instantly share code, notes, and snippets.

@hanachin
Created December 9, 2010 14:11
Show Gist options
  • Save hanachin/734740 to your computer and use it in GitHub Desktop.
Save hanachin/734740 to your computer and use it in GitHub Desktop.
js 1.8でFizzBuzzのようなもの。さっきのよりすっきりだね
(function (MAX)
((function (f)
(function (p)
f(function (arg)
(p(p))(arg)))
(function (p)
f(function (arg)
(p(p))(arg))))
(function (f)
function (n)
(function (t)
(function (f)
n <= MAX ? t() : f())
(function () ""))
(function ()
((function (str)
((function (str)
n + str)
((function (str)
" -> " + str)
((function (str)
"" !== str ? str : n)
((function (str)
((n % 5) ? str : (function (str2) str + str2)("Buzz")))
((function (str)
((n % 3) ? str : (function (str2) str + str2)("Fizz")))
("")))))) + str)
((function (str)
"\n" + str)
(f((function (x) n + x)(1))))))))(1))(100);
@hanachin
Copy link
Author

hanachin commented May 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment