3 ms·
I'm not sure I understand how it's "self replicating"? An empty file, compiled or not, won't replicate itself. The Makefile to compile the empty c file is also
by Alupis 12y ago
I'm not sure I understand how it's "self replicating"? An empty file, compiled or not, won't replicate itself. The Makefile to compile the empty c file is also rather large, but even it must be executed in a loop.
Can someone explain the basis of this contest and how this c file is "self-replicating"?
- michael_fine 12y agoI think what they were referring to was a quine
- fsniper 12y agoIf you also look into the Makefile accompanied, it's just copying itself to smr file and giving it executable rights. So smr.c when built outputs it's source code. The makefile is not large. It's a makefile for all the entries for 1994 competition. And it's only 4 lines for smr.c
- pdkl95 12y agoIt's abuse of the contest rules, which encouraged at the IOCCC. You just have to be absolutely certain that it really IS "technically valid"[1] or it risks disqualification. This one abuses the idea that they specify how the contest will be judged, which this "program" satisfies, as long as you don't look at the source. $ make smr cp smr.c smr chmod +x smr $ ./smr > smr.dup $ diff smr smr.dup $ echo $? 0 Also, it is a valid C file! $ stat -c "%s" smr.c 0 $ gcc -Wall -c smr.c $ echo $? 0 $ stat -c "%s" smr.o 927 The judge's comments for this one explain this in a bit more detail: http://www.ioccc.org/1994/smr.hint http://www.ioccc.org/1994/smr.hint [1] the best kind of "valid" :)