Below, you can find another hint for the Challenge.
You should only get here after reading, digesting, and applying the .
First, we create the skeleton for the self-reproducing program (note the hole marked by #):
This skeleton needs to be encoded, formatted, and inserted in place of #. We can accomplish that as follows by using encode() defined in Hint 38, and transcribe():
where we supply the skeleton above as input. Of course, the definitions of transcribe() and copy() must be included as well.
You should . It outputs:
And, drum rolls, this output is, once more, a program that writes itself as output, as you should definitely . Can you see the elegance of this program and the way it was constructed?
Using an array of strings (which we did not include in the JavaScript basics), you can simplify the program somewhat, because that allows you to get rid of the newline markers. If you are still up to it, you can have a go at this.
Try your program in the machine, and see if you can come up with a new solution.
It is your turn ...
If you tried this hint, or do not see how it helps, then you are ready for the .