r/programming • • Aug 10 '12

Write any javascript code with just these characters: ()[]{}+!

http://patriciopalladino.com/blog/2012/08/09/non-alphanumeric-javascript.html
1.3k Upvotes

288 comments sorted by

View all comments

-3

u/wickedhood Aug 10 '12

The website doesn't work. It just freezes when you try to convert a script.

16

u/nemec Aug 10 '12

How large of a script are you converting?

alert(1) becomes

[][(![]+[])[!+[]+!![]+!![]]+({}+[])[+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]]]({}+[])[!+[]+!![]+!![]+!![]+!![]]+{}+[])[+!![]]+([][+[]]+[])[+!![]]+(![]+[])[!+[]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][+[]]+[])[+[]]+({}+[])[!+[]+!![]+!![]+!![]+!![]]+(!![]+[])[+[]]+({}+[])[+!![]]+(!![]+[])[+!![]][!+[]+!![]+!![]]+([][+[]]+[])[!+[]+!![]+!![]])()(({}+[])[+[]])[+[]]+(!+[]+!![]+!![]+[])+{}+[])[!+[]+!![]]))()

So I imagine a larger script will take a while to convert.

0

u/wickedhood Aug 10 '12

it was massive compared to alert(1)