Created
May 21, 2011 21:55
-
-
Save cowboy/984932 to your computer and use it in GitHub Desktop.
What results can you get just using these characters: +[]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// What results can you get just using these characters: +[] | |
// I know this has been done before, but I don't have the link, | |
// and I don't want it (not yet, at least) | |
// basic numbers | |
0: +[] | |
1: ++[+[]][+[]] | |
2: ++[++[+[]][+[]]][+[]] | |
3: ++[++[++[+[]][+[]]][+[]]][+[]] | |
4: ++[++[++[++[+[]][+[]]][+[]]][+[]]][+[]] | |
5: ++[++[++[++[++[+[]][+[]]][+[]]][+[]]][+[]]][+[]] | |
... | |
// add +[] at the end to coerce into string | |
'0': +[]+[] | |
'1': ++[+[]][+[]]+[] | |
'2': ++[++[+[]][+[]]][+[]]+[] | |
'3': ++[++[++[+[]][+[]]][+[]]][+[]]+[] | |
'4': ++[++[++[++[+[]][+[]]][+[]]][+[]]][+[]]+[] | |
'5': ++[++[++[++[++[+[]][+[]]][+[]]][+[]]][+[]]][+[]]+[] | |
... | |
// string concat (any number or string-of-a-number is clearly possible) | |
'10': ++[+[]][+[]]+[]+[+[]][+[]] | |
10: +[++[+[]][+[]]+[]+[+[]][+[]]][+[]] | |
11: ++[++[+[]][+[]]+[]+[+[]][+[]]][+[]] | |
... | |
// more goodies | |
'': []+[] | |
undefined: [][+[]] | |
'undefined': [][+[]]+[] | |
'u': [[]+[]+[][+[]]][+[]][+[]] | |
'n': [[]+[]+[][+[]]][+[]][++[+[]][+[]]] | |
'd': [[]+[]+[][+[]]][+[]][++[++[+[]][+[]]][+[]]] | |
'e': [[]+[]+[][+[]]][+[]][++[++[++[+[]][+[]]][+[]]][+[]]] | |
'f': [[]+[]+[][+[]]][+[]][++[++[++[++[+[]][+[]]][+[]]][+[]]][+[]]] | |
'i': [[]+[]+[][+[]]][+[]][++[++[++[++[++[+[]][+[]]][+[]]][+[]]][+[]]][+[]]] | |
NaN: +[][+[]] | |
'NaN': +[][+[]]+[] | |
'N': [+[][+[]]+[]][+[]][+[]] | |
'a': [+[][+[]]+[]][+[]][++[+[]][+[]]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(also) NaN: +[][[]]
Beyond what's here, I think you need
()
to get "Infinity" (As I vaguely recall from that listing, which I also can't find :\ )