Below, you can find another hint for the Challenge.
You should only get here after reading, digesting, and applying the .
It is more conventient to change the name of the global variable S after introducing parameters for the functions. The reason is that the name of the global variable now appears in many places.
It only seems natural to give the function copy() one string parameter, say s, which copy(s) will write (copy) to the output as a multi-line string expression having value s. That way, the function copy(s) has become a more general tool, because it now works for any argument s and not only for the global variable. Such a more general function is often easier to understand, and easier to verify and test.
Similarly, we can give the function transcribe() a string parameter. To make transcribe() even more general, we can give it two string parameters s and t, where transcribe(s, t) will transcribe string s to the output, inserting a copy of t in the appropriate place. (How to determine that place more conveniently is a later problem.)
Again, we can bring about these changes by first adapting the blueprint, and then taking the output as our new program. Here is the program with a new blueprint, where the functions have parameters:
It outputs ():
This new program outputs itself ().
Can you improve this solution further? On the wish list we still have:
Try your program in the machine, and see if you can extend it to 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 .