DPRG
DPRG List  



DPRG: My .signature

Subject: DPRG: My .signature
From: MIKE MCCARTY -- 93789 JMCCARTY at DEVEL.USA.ALCATEL.COM
Date: Fri Aug 27 12:28:48 CDT 1999

)I am interested in the technique.  Could you forward my some more 
)information?  Thank you.

Oops! I thought this was private e-mail, and had not intended to post
to the list. One of the features of this mailer is that once one starts
to reply to mail, one is comitted.

............................................................

Here's how it works:

There are two parts to the program: a replicator part, and a control
part. The replicator part replicates whatever it is handed, and then
appends a copy of the control part. It therefore "knows" the
instructions to make a control part. It "knows" nothing about itself.
The control part passes a copy of the replicator to the replicator. It
therefore "knows" the instructions to make the replicator, but "knows"
nothing about itself. When the program is run, the control part makes a
replicator template, and passes it to the replicator. The replicator
replicates the copy of itself, thus making another replicator, and then
adds a copy of the control, hence making a whole new program.

This particular source is not original with me. Nor are the ideas it
embodies. But I did design and write programs with the same ideas in
them without help.

Ok, here's the replicator

	"char *p=%c%s%c;main(){printf(p,34,p,34);}"

This forms instructions to printf() to replicate whatver is passed to
printf(), and append a copy of the "control part"

Here is the control part

	main(){printf(p,34,p,34);}

It passes a copy of the replicator (named "p") to itself (hence the two
copies of p used, once as the replicator [format string, first argument
to printf) and once as the thing to be replicated [the third argument to
printf()]).

Again, my apologies for posting to the list rather than private e-mail.

Mike
- ----
char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
I do not speak for Alcatel. <- They make me say that.
This message made from 100% recycled bits.

------------------------------

More information about the DPRG mailing list