Hehe funny that you mention phiX174 in the context of programming, that virus is amazing... Part of the reason phiX174 is so small is that it is "compressed" by having overlapping genes; in one area, three genes overlap in the same place! This is possible because there are 6 valid reading frames (direction and start point) for reading DNA: {forward or backward} x {address % 3 == 0, 1, or 2}.
In college I actually got to take part in refactoring that virus' genome into a decompressed version with no gene overlaps. And it worked! The decompressed version is still a functioning phage, and since there are no longer gene overlaps, future genetic engineers will have a much easier time modifying the phage as they see fit.
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"?
It'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.
If 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
There is PDP-11 command (one word, 16 bits) which makes a copy of itself into a previous word (with address, in bytes, less by two) and passes the control to the new copy. Octal 103737... or something like that.
Doesn't require make :) or cp and is pretty active - fills up all the memory space below the starting point in no time.
I hang out on /r/dailyprogrammer sometimes - they had a challenge about these types of programs the other day and called them "quines." Check through some of these if you're interested, a few are 2 characters long (not sure how many bytes that is): http://www.reddit.com/r/dailyprogrammer/comments/2n11w8/2014...
I once wrote an implementation of the classic Redcode "Imp" program in x86 assembly. It does not satisfy the requirements of this contest, but it does act as the Imp program, perpetually copying itself through RAM. :-)
Isn't this a quine, rather than a self-replicating program? A quine produces the source, and a self-replicating program should produce an executable - no? This seems to be a fallacy of equivocation.
[+] [-] corwinbad|11 years ago|reply
http://www.ncbi.nlm.nih.gov/nuccore/NC_001422.1
Enterobacteria phage phiX174 sensu lato, complete genome
5386 bp ss-DNA
[+] [-] jonmrodriguez|11 years ago|reply
In college I actually got to take part in refactoring that virus' genome into a decompressed version with no gene overlaps. And it worked! The decompressed version is still a functioning phage, and since there are no longer gene overlaps, future genetic engineers will have a much easier time modifying the phage as they see fit.
http://www.sciencedirect.com/science/article/pii/S0042682212...
[+] [-] TazeTSchnitzel|11 years ago|reply
[+] [-] TillE|11 years ago|reply
[+] [-] Alupis|11 years ago|reply
Can someone explain the basis of this contest and how this c file is "self-replicating"?
[+] [-] pdkl95|11 years ago|reply
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.
Also, it is a valid C file! The judge's comments for this one explain this in a bit more detail:http://www.ioccc.org/1994/smr.hint
[1] the best kind of "valid" :)
[+] [-] fsniper|11 years ago|reply
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
[+] [-] michael_fine|11 years ago|reply
[+] [-] avmich|11 years ago|reply
Doesn't require make :) or cp and is pretty active - fills up all the memory space below the starting point in no time.
[+] [-] 51Cards|11 years ago|reply
[+] [-] TazeTSchnitzel|11 years ago|reply
[+] [-] silverfox17|11 years ago|reply
[+] [-] TheSoftwareGuy|11 years ago|reply
[+] [-] sysk|11 years ago|reply
[+] [-] mojuba|11 years ago|reply
[+] [-] mct|11 years ago|reply
I just uploaded it to https://github.com/mct/assembly-toys/tree/master/imp
[+] [-] ismailmechbal|11 years ago|reply
[+] [-] unknown|11 years ago|reply
[deleted]
[+] [-] kremlin|11 years ago|reply
[+] [-] pdkl95|11 years ago|reply
[+] [-] FireRabbit|11 years ago|reply
[+] [-] NaNaN|11 years ago|reply
[+] [-] Varcht|11 years ago|reply
[+] [-] mjcohen|11 years ago|reply
[+] [-] disputin|11 years ago|reply
[+] [-] palunon|11 years ago|reply
[+] [-] TazeTSchnitzel|11 years ago|reply
[+] [-] chaosfox|11 years ago|reply
[+] [-] simarpreet007|11 years ago|reply