Hints for the Challenge:

Below, you can find another hint for the Challenge.

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

Hint

For completeness sake, here is a self-reproducing program using an array of strings (like a set of chromosomes; see if you can understand it):

You can that this program also outputs itself.

Once you know what all these functions do, you can also eliminate them to reduce the program's length:

And, voila, yet another self-reproducing program ().

If you do not mind cheating a bit, then the shortest self-reproducing program for Tom's JavaScript Machine that I know of is this ():

It basically uses the same idea as the other programs we have seen, but it looks like a lucky accident and it is less general. Compare this to the solution shown in Hint 39, which contains very general copy and transcribe functionality. This opens the door for much more complex self-reproducing programs, that also have other functionality.

By now you have seen so many self-reproducing programs, that you might start to believe that they are actually very common. Now you are ready for some afterthoughts.


Valid HTML 4.01 Transitional

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