2 ms·
Ah, but there is a science behind writing such things. They're called quines. Here's one I wrote: http://chris.pacejo.net/postscript/quine.ps http://chris.pac
by colanderman 12y ago
Ah, but there is a science behind writing such things. They're called quines. Here's one I wrote: http://chris.pacejo.net/postscript/quine.ps http://chris.pacejo.net/postscript/quine.ps
The trick is that the part of the number (program) that encodes the image of the number doesn't need to encode the image of itself -- that can merely be created directly from that part of the number. See e.g. the source of (or output of!) the quine I linked. The first half of the program is the "image"; the second half basically just prints the "image" once as it is represented in the source, and again after interpreting it a bit. (In fact this way you don't even need to compress the "image"... the compression comes from the fact that your "program" is roughly just two copies of the same thing.)