OK, so I’ve got 383 lines and 11 kilobytes. As we all know, 20 lines of 80 char code is 1600 bytes, so there’s way to go… I checked with google closure compiler, how I could squish that – after compressing, it was about 5 kilos. Still too much. After hours of merging functions, deleting smooth line bezier-based rendering, reusing some vars, it went down to about 3 kilos.
I started to think that its impossible to do, unless some miracle happens.
Then I had a moment of enlightning – it’s 20 lines of 80 characters challenge, not 1600 bytes challenge. How about UTF-16? I could write 2 bytes inside 1 UTF16 character.
It worked! Excited, I searched on google if anyone else did it – of course someone already came up with that idea ;/ And the idea was better because the decoder is like:
And mine was much longer and 2 lines:
c>>8?A.push(c>>8):c;}return String.fromCharCode.apply(String,A)}("SOME STRING");
But my method used a bit different technique, so I could use normal letters and fit some ASCII art inside the code, not only some strange chinese letters.
OK, so after compiling with google closure, making big eval and changing to UTF-16, the code looks like this:
And can be seen on the challengepost’s winners’ ( ͡° ͜ʖ ͡°) gallery:
or JSFiddle: http://jsfiddle.net/to267224/tbgad7uz/
ps. I will enhance this post later maybe, to provide some missing info on technical things and add some images, cause there’s too much unformatted text ; )