[comp.lang.pascal] SELF-REPRODUCING PROGRAMS II

markh@csd4.milw.wisc.edu (Mark William Hopkins) (03/02/88)

In a prior article, I wrote the description of a project to make a program to
reproduce itself in Pascal.  I suggested that the program should replicate 
itself into a file with a different name than the original program file's.  
Further it should be done in such a way that the offspring of successive
generations are placed into files of distinct names, solely by the programs'
actions.

This is a continuation on the original project.

     Once you've succeeded in creating a self-reproducing program in Pascal,
you'll begin to see a general method for making any program self-reproducing.
You are then ready to pursue the following project:

     Write a program whose input is a file containing a Pascal program
     and whose output is a copy of the original program with a self-
     replicator added to it.  Thus the output file contains a copy of the
     input program file, except that it can reproduce itself.

     This program is a universal replicator.  Test the program by running it
     on itself.  Test it by running it on a Pascal compiler written in Pascal.