26
4
Challenge
In this challenge, you will be writing the first program, p1, of an infinite sequence of programs, in which running pn outputs/generates program pn+1. When concatenating the first n >= 2 programs, the sequence should output n
.
Example
Let's say the first 4 programs are:
p1 p2 p3 p4
If I were to run p1
, it should output:
p2
If I were to run p1p2
, it should output:
2
If I were to run p1p2p3p4
it should output:
4
If I were to run p4
, it should generate the next program in the sequence:
p5
Scoring
Your score is the byte count of the first 10
programs.
Will the sequences
p1p2p3...
always be from from p1 to pn? – Moose – 9 years ago@Moose Yes, it will always be from p1 to pn. – Downgoat – 9 years ago
5This is an interesting problem. The program sequence is easy enough; the chaining is harder. – Conor O'Brien – 9 years ago
Is accessing files allowed? – Lynn – 9 years ago
@Mauris Yes but the file's content's & name's byte count must be counted in the total byte count for each program it is used in. – Downgoat – 9 years ago
@CᴏɴᴏʀO'Bʀɪᴇɴ In some languages it's the other way around – SuperJedi224 – 9 years ago
@SuperJedi224 Such as? – Conor O'Brien – 9 years ago
This would seem to be the case in, for example, befunge. – SuperJedi224 – 9 years ago