Below, you can find another hint for the Challenge.
You should only get here after reading, digesting, and applying the .
It is a bit cumbersome to produce the blueprint, because first you need to complete the program by adding the definition of the blueprint without string expression (leaving a hole) and the main program:
This completed program then must be encoded in the blueprint and formatted appropriately (as copy() would do it).
Instead of doing this by hand, it seems only natural to let a program do that. We can easily put together the complete program with a hole for the blueprint. We need a function to encode this program into a string (the inverse of transcribe()). By using copy() we can format the string appropriately, and by using transcribe() we can put the blueprint into the program.
Here is a function to encode a string (do the inverse transcription):
Note that it uses the same variables as we defined earlier. Instead of writing its result to the output area, it produces a string with the result. This has the advantage that we can feed the string into other functions. Furthermore, we used the variables NL and QU to recognize (genuine) newlines and quotes, and the symbol # as placeholder for the blueprint marker (we assume that it does not occur elsewhere). Since this function will not be part of our self-reproducing program, that is not an issue. We just use encode() as a construction tool.
We can test it interactively by providing a main program:
and providing some test input (cf. the test in Hint 37):
This produces as output (you should ):
Can you complete the construction, using encode() and transcribe()?
Try your program in the machine, and see if you have obtained an improved solution.
It is your turn ...
If you tried this hint, or do not see how it helps, then you are ready for the .