aemkei / jsfuck

Write any JavaScript with 6 Characters: []()!+
jsfuck.com
Do What The F*ck You Want To Public License
8.16k stars 674 forks source link

Mapping: reduce generated code for ABFS{() and <sp> #15

Closed subzey closed 11 years ago

subzey commented 11 years ago

Prepending garabge of certain length to string in order to minimize sum of digits in indices

hazzik commented 11 years ago

Anton, could you run integration test to generate output.txt?

hazzik commented 11 years ago

Also: 'o': '(true+[]["filter"])[10]',

hazzik commented 11 years ago

Also: 'g': '(+false+""+false+String+"")[20]',

subzey commented 11 years ago

Here comes the output.txt. It seems there's a plently of places for this optimization, thanks.

hazzik commented 11 years ago

And even more:

'y': '(NaN+[Infinity])[10]' '{': '(NaN+[]["filter"])[21]', (remove +"") *'g': '(+false+[false+String])[20]' (remove +"")

hazzik commented 11 years ago

You can reduce i even more: 'i': '([false]+undefined)[10]'

subzey commented 11 years ago

@hazzik, thanks again

hazzik commented 11 years ago

I have an optimization of numbers substitution to MAPPING's templates and the 978656e commit makes "/" 4 chars bigger.

hazzik commented 11 years ago

Please ignore last comment

aemkei commented 11 years ago

Thank you both for the great work! I merged both pull requests and updated the version online.

PS: Have you seen the original thread at http://sla.ckers.org/forum/read.php?24,32930 ?

hazzik commented 11 years ago

I have more optimizations comming.