Path: utzoo!mnetor!uunet!husc6!rutgers!ames!amdcad!sun!plx!dlb!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.pascal Subject: Re: Self-replicating programs Message-ID: <188@goofy.megatest.UUCP> Date: 26 Dec 87 01:00:51 GMT References: <52@qucis.UUCP> Organization: Megatest Corporation, San Jose, Ca Lines: 40 in article <52@qucis.UUCP>, levison@qucis.UUCP (Mike Levison) says: > > > > This is probably more than you ever wanted to know on self- > replicating programs: > > Self-Reproducing Program (Pascal version) > > The basic idea is to create within the program an array of > characters which consists of the whole program EXCEPT for > the assignments which initialize the array. The array is > then used once for printing the basic program, and a second > for printing the assignments. > > Ignore for a moment two minor annoyances: line layout, and > the fact that one cannot assign or output quotemarks using > c[i]:= ''' or write('''). Both can be overcome trivially at > the expense of clarity. Then the program is as follows (the > comments are not part of it): [...] The "quotemark" problem is the only hard problem. How do you make this program character-set independant? (The one I posted will work just as well on an EBCDIC machine as on an ASCII machine. This posting does not contain everything I want ot know on self-replicating programs. Dave Jones Megatest Corp. 880 Fox Lane San Jose, CA. 95131 (408) 437-9700 Ext 3227 UUCP: ucbvax!sun!megatest!djones ARPA: megatest!djones@riacs.ARPA