Hacker News new | ask | show | jobs
by myndzi 4659 days ago
I was interested in how this might be shrunk to something more reasonable... I got this far before getting bored: http://pastie.org/8324713

That code, run as-is in your browser, should alert 'hi'.

It's constructed with the intent of replacing the variables a-e and various named parameters with short sequences in the given character set that can be cast to strings. For legibility, I shortened many of the encodable sequences to strings (such as []["slice"])

The table holds 5^3 characters, which is 125; you could start the loop at 2 instead of 0 to get 2-127 as target characters, or use 6 input arguments. The 5 I chose were ![], [], +[], +{}, ~[] -- this should let you encode anything after overhead at a ratio of 12:1 with high repetition that gzip can take advantage of. This could be awful, I don't know; but maybe somebody will find this interesting.