Coder's Guild Mailing List

Self replicating code

Posted by Benjamin Johnston on 2001-03-20

> Not quite sure what that is meant to do.

It is actually a Quine... a program that when run will print its own source
(without actually "peeking at is source", for example by dumping the file it
was executed from).

Unless you've got another Quine to work from (as an example) these are
rather tricky to come up with, and some Quines are really quite clever.

Take a look at "The Quine Page";

http://www.nyx.net/~gthompso/quine.htm

They differ from virii in the sense that virii aren't printing their code to
the screen - and because virii typically replicate by reading the actual
bytes that are being executed (ie. they're cheating (from the point of view
of a quine writer)).

-Benjamin Johnston
s355171@xxxxxxx.xx.xxx.xx