Last active
November 29, 2017 03:57
-
-
Save kevincharm/ddd5f0e954063cd81f7a40e9e361178e to your computer and use it in GitHub Desktop.
The Fizziest of Buzzes. Note: this is a joke.
This file contains hidden or 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
const magic = 0x46697a7a | |
const witchcraft = magic ^ (0x41c << 16) | |
const u = x => a => b => (x >> a) + (x & b) | |
const v = x => a => b => x > a ? x - b : x | |
const w = x => u(u(u(x)(16)(0xffff))(8)(0xff))(4)(0xf) | |
const rin = x => s => !!parseInt(x) ? s : x + s | |
const c = x => a => b => String.fromCharCode((x >> a) & b) | |
const cccc = x => c(x)(24)(0xff)+c(x)(16)(0xff)+c(x)(8)(0xff)+c(x)(0)(0xff) | |
const fizz = x => !(v(u(u(u(w(x))(2)(3))(2)(3))(2)(3))(2)(3)) | |
const buzz = x => !(v(v(v(w(x))(14)(15))(4)(5))(4)(5)) | |
const fizzbuzz = i => j => { | |
let x = fizz(i) ? cccc(magic) : i | |
x = buzz(i) ? rin(x)(cccc(witchcraft)) : x | |
return i < j ? x + '\n' + fizzbuzz(i+1)(j) : x | |
} | |
console.log(fizzbuzz(1)(100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wow this is now truly horrible.
So bad it's !!good.