6
1
You need to write a program in any language that will produce (source code for) a program in a different language. That program will produce a 3rd program in another language and so on.
You should aim to create many programs; you aren't limited to 3. You can re-use a language, but it won't be counted in the scoring.
Your entry is the source code of the first program, together with a list of the languages of subsequent programs produced in the order they are produced. For easy reading maybe include each program's output/source.
Scoring will be the length of the source code of the first program divided by the number of different languages used.
To prevent solutions such as 1
(that has been pointed out in the comments) I suggest the following extra rule:
The output of one program must not be valid code in the language of that program.
9You do know that
1
is at the very least a Golfscript program that outputs a PHP program that outputs an APL program that outputs a J program that outputs a Perl program that outputs nothing, right? – marinus – 2013-07-16T12:04:55.6639
Or what about this non-trivial quine version, going through 50 languages: https://github.com/mame/quine-relay
– daniero – 2013-07-16T12:52:25.370Similar to http://codegolf.stackexchange.com/questions/2582/golf-a-mutual-quine
– Peter Taylor – 2013-07-16T13:22:44.617@marinus: maybe I should add a rule that states the source code produced for the next language must be invalid in the one producing it. – George Duckett – 2013-07-16T13:35:31.280
@marinus: I'm curious what your point is. Are you suggesting that nobody should pose a challenge which can be trivially accomplished with GolfScript? That would make most challenges moot, and render this stackexchange site pointless. Is it perhaps better to consider non-GolfScript solutions worthwhile in spite of the existence of GolfScript? – Igby Largeman – 2013-07-17T03:57:41.280
Many languages accept bare numbers as valid programs that output that number. It has nothing to do with Golfscript per se. – breadbox – 2013-07-17T07:51:42.733
@IgbyLargeman, surely by definition anything which can be "trivially accomplished" isn't a challenge? – Peter Taylor – 2013-07-17T08:24:28.973
@IgbyLargeman: I was just pointing out a loophole in the question that would allow trivial answers like
1
to win, because that would make the question uninteresting. George has indeed fixed it now. – marinus – 2013-07-17T10:59:32.600Wow. Did anyone look at the source of the quine-relay? It is even ascii art. – Johannes Kuhn – 2013-07-17T21:48:37.077