numbers for people.

Make words with JavaScript brackets

Since I work for one of the nerdiest places on earth I wasn’t surprised when our sales team started sending me messages as Brainfuck programs.


But who has a Brainfuck compiler handy? Everyone has a JavaScript interpreter… maybe I can use that. I seem to remember JavaScript plays fast and loose with types, for instance [![]]+[][[]]+[!![]]

And we can make numbers just as painfully: +[] and +!+[]. So we can pluck letters out of those words, like we can pull an “r” out of “true”: (!![]+[])[+!+[]]. (I can also get a capital N out of (+!+[])/(+!+[]+!+[])[+!+[]]

Ok, there’s a lot of vowels in there, I wonder how close we are:

grep -i '^[falseundefinedtrue]*$' /usr/share/dict/words | wc -w

Cool, we can make almost 9000 words. That sounds like a lot, but I don’t know how many are in the OS X words file.

wc -w /usr/share/dict/words

Oh. Out of 235886, that’s barely 3.3%. That’s a little disappointing. But we can get creative, 0 is the only vowel missing.

grep -i '^[falseundefinedtrueo]*$' /usr/share/dict/words | wc -w

Ok 6.4%, what if we stretch things a bit further with 2=Z, 3=B, 6=G… Hmm 33049 words. 14%, come on english language, you’re killing me here. (Sadly, the stats don’t seem much better even for Hawaiian)

Well, how close can we get with these? How important are “..c….h.jk.m..pq….vwxy.”?

grep -i '^[falseundefinedtrueozbg]*$' /usr/share/dict/words | wc -w

Ok, what if I can bring spacing back? Adding a / symbol still looks cool enough +!+[]/(+!+[]+!+[])+[+[]] has a dot. And after a few manual tweaks, we still have a string that needs some decoding:

  • 1..sauu..tne..3est..nninds..0f..nnie..9enerati0n..destr0ieed..3ie..nnadness..staruin9..niesterieal

That’s kind of totally readable! And now the moment you’ve all been waiting for: Let’s turn it into []+/!()‘s

Give me a string:

Cool, eh?