5
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.
Example
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. A
, B
and C
are all valid in the same language and are all different by at least one character.
Scoring
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 A
, B
and 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 A
.
This incentivize both golfing your initial code, and having an initial program that leads to a longer chain.
The smallest score wins
This incentivizes long programs with long cycles too much. – lirtosiast – 2015-07-04T00:00:54.177
@ThomasKwa Maybe, but I'm not sure how hard it will be to increase cycles lengths compared to the length of the initial program. I'm opened to other formulas for scoring if it turns out to favor one side too much. – Fatalize – 2015-07-04T00:03:38.580
2How about
bytes/sqrt(log(cyclelength))
, or evenbytes/log(log(cyclelength))
? – lirtosiast – 2015-07-04T00:07:29.8733@ThomasKwa: Yup, we need a new scoring algorithm. – Dennis – 2015-07-04T00:13:36.643
Actually, even
log(log(cyclelength))
is too much once this becomes a largest-number contest. The cyclelength part of the score should be bounded above. – lirtosiast – 2015-07-04T00:25:02.547I don't see a way to make this an interesting contest. Using
sqrt(log_2(cyclelength))
capped at, say, 16 for the denominator would at least prevent arbitrarily small scores, but then Dennis' original1e9
program would be close to the optimal score. – lirtosiast – 2015-07-04T05:55:25.2832Could you explain the title? I can't see the connection with permutation groups. – Peter Taylor – 2015-07-04T07:03:07.130
@PeterTaylor Each program is the output of another one, and you get back to your initial program after enough runs, kinda like a Rubik's Cube. But that ends there, "Quine cycle" souded strange so I chose something innacurate but that sounds cooler – Fatalize – 2015-07-04T07:12:42.693
1So why not use the standard term: ouroboros? Does that not sound cool enough? – Peter Taylor – 2015-07-04T09:41:18.920
@PeterTaylor I wouldn't really call that a standard term! Sounds cool but din't think about it – Fatalize – 2015-07-04T09:55:36.687
Or possibly just enforce a maximum length? – SuperJedi224 – 2016-12-13T01:14:25.947