@BusinessCat 1. Construct individual letters with e.g. ([]+![])[+[]] ("false"[0], or "f"). 2. Build up a string such as fill or filter, then do e.g. []["filter"]. 3. Build up the string constructor so you are now doing []["filter"]["constructor"]. This returns the Function function. 4. Use Function to create a function out of a string and evaluate it.
If you call a function e.g. myFunc`abc${123}xyz` , it will actually call it as myFunc(["abc","xyz"],123), making calling function with arbitrary arguments pretty much impossible
Another thing I considered was using => to create literals rather than [], but the problem with that is that now we have no valid expressions because ()=>() doesn't work
I'm seeing if I can construct that 36 using templates.
Although (25)["toString"](`${!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]+!![]}`) works, without parentheses does not.
and to do recursion, what you do is you create a function with a long string inside the ```
that contains the function body
then get it to call itself at the end
via extracting it back out of a property
you can even do an if statement via making the property an array, and indexing into it (this is an INTERCAL trick)
gah, it doesn't quite work, you can't nest uses of ``
so you can't do any further calls from the inside function
a = [10,Function`[a[a[0]]=a[0],a[0]=a[0]-1,a[1]()]`]; a[1]``
that's my proof of concept
but unfortunately there are those awful parentheses in the inside definition
it does work apart from that, though
if you try running it, you'll see that after it crashes with an error, a will be set to [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], which is pretty good evidence that there's a working loop there
[]["constructor"]["a"]=[] sets Function.a to the empty array (of course, we'd compute those strings with []+= too)
So []["constructor"]["a"]=[];[]["constructor"]["a"]["toString"]=[]["fill"]["constructor"]`[]["constructor"]["a"]+[]`;[]["constructor"]["a"]+[] causes an infinite recursion error