Hints for the Generalized Challenge:

Below, you can find another hint for the Generalized Challenge.

You should only get here after reading, digesting, and applying the .

Hint

Now that we have adapted functions copy and transcribe that return a string, we can generate the string containing the program's source code and process it in other ways than just outputting it for self-reproduction. For instance, a program that outputs its own shadow could be made like this:

When replacing write_shadow(self) by write(self), we can obtain again a self-reproducing program.

Complete the program that outputs its own shadow, and generalize it to do other processing of the program's own source code.

Note: This approach does require more memory, because the whole string containing the program's source code is constructed and stored before it is used. The version of the program that writes characters directly from copy and transcribe does not stockpile information, but uses and discards each piece directly after it is generated.

In JavaScript, it is not so easy to generate the string self on demand of the processing part of the program (JavaScript does not have lazy evaluation).

Apply the hint [ Machine ]

It is your turn ...

Need Another Hint?

If you have no idea how to get started, or if you tried some programs and do not see how to proceed, then you are ready for the .


Valid HTML 4.01 Transitional

Copyright ©2010, Tom Verhoeff, T.Verhoeff@TUE.NL