This question already has an answer here:
- Can you Meta Quine? 6 answers
Write a program or function which, when run, outputs another program or function which is valid in the same language as the original program, and which itself will output another program or function that has the same properties. You must at one point end up back to your initial program or function.
Suppose you write program
A. When run, it outputs program
B. When you run
B, it outputs program
C. When you run
C, it outputs program
A, thus completing the circle.
C are all valid in the same language and are all different by at least one character.
Your score is calculated as
<Number of bytes of the initial program>/<number of iterations to get back to the initial program>
For instance, with the programs
C in the previous example, the number of iterations is
3 (you have to run 3 times to get back to
A) and the number of bytes is the number of bytes of
This incentivize both golfing your initial code, and having an initial program that leads to a longer chain.
The smallest score wins