6
Write a self replicating program, in the source code filename H.*
, contianed in an empty folder then manually compile and run or just run the program if your chosen language is dynamic, and it should then just create a new source file, e.*
, with the same exact source code, and automatically compile/run that new program, which makes the new source file l.*
, etc. until the source file !.*
is made, and that program should do essentially nothing once it is compiled/run. "Hello world!" has some repeated characters, so the second character should be created by a similar filename, just with a new <space>
at the end. Programs that just make/compile source files from the single instance of the program are invalid, and yes, " " is a valid filename. It should appear to say "Hello World!" when viewed in the file explorer sorted by time created.
For example, if you were to attempt this challenge in python, than you would create the source file H.py
, which complies and runs e.py
, which then itself creates l.py
, that file l .py
, o.py
, .py
, w.py
, o .py
, r.py
, l .py
and d.py
which finally creates and runs !.py
, which does not do anything once run.
"Self-replicating" implies that the program creates another file exactly identical to the original. Do the files all have to be identical, so that they have to read their own filename? – Doorknob – 2015-05-24T22:31:28.033
maybe re-write this as an ouroboros challenge? instead of the programs compiling the next one, just output the source, so H.py produces e.py... d.py produces H.py – Sparr – 2015-05-24T22:45:45.477
@Doorknob yes, They would have to have the same content, and need to check their filename to see what to make the next one called. – micsthepick – 2015-05-24T23:58:57.397
Shouldn't the example end with
!.py
? Also, it states thate.*
should createe.*
again. – LegionMammal978 – 2015-05-25T00:51:14.900@LegionMammal978 Fixed. – micsthepick – 2015-05-25T00:55:04.043
2There are 3
l
s inHello world!
. What should the filename of the 3rd be? – jimmy23013 – 2015-05-25T01:31:22.583@user23013 add another space. – micsthepick – 2015-05-25T06:44:10.863
filenames are
H.*
,e.*
,l.*
,l .*
,o.*
,.*
,w.*
,o .*
,r.*
,l .*
,d.*
and!.*
– micsthepick – 2015-05-25T09:16:01.203Will the directory initially be empty, apart from the code itself? If not, then will it have files with the same extension? – LegionMammal978 – 2015-05-25T18:20:33.980
Added a condition, start with an empty folder containing only
H.py
– micsthepick – 2015-05-25T21:53:44.760If we don't need an extension, can our files just be
H
,e
, etc? – 2012rcampion – 2015-05-26T03:33:39.393