Stop Internet Warming!

-5

Task

Write a program that will output another distinct program, and so on, while using as few distinct characters (and as few bytes) as possible.

For example, program 1 should output program 2, and when program 2 is executed, it should output program 3. This can be nested as deeply as needed, but must be at least 3 distinct programs deep.


Rules

  • Your program can take no input.

  • When the program is executed, the output should be the source of another, different program. This includes the STDERR stream. This can continue as many times as needed, but must occur at least three times.

  • The output source code may be in a separate language.


Example

$ <program-1>
<program-2>

$ <program-2>
<program-3>

$ <program-3>
<empty>

Scoring

Each answer is scored by the following formula:

(length_in_bytes * number_of_distinct_characters) / number_of_distinct_programs 

For example, if your answer was 10 bytes long, contained 5 distinct characters, and output 3 distinct programs, your score would be:

(10 * 5) / 3

or 16.66.

Lowest score wins.


Note: This challenge was inspired by the comments on this StackOverflow question.

Zach Gates

Posted 2016-01-14T06:28:58.543

Reputation: 6 152

Question was closed 2016-01-14T08:36:03.407

I suggest you add "lowest score wins" and remove anything above the TL;DR as per this meta answer

– agtoever – 2016-01-14T08:09:26.373

5I'm voting to close as too broad because there is no criteria on what the programs should do, other than spitting out other programs. It would be trivial to create an infinite sequence of programs in stack-based languages with implicit output like Seriously. – Mego – 2016-01-14T08:10:44.197

What's the score if you create infinite programs? 0? – agtoever – 2016-01-14T08:11:02.303

For example: Q;+ will result in an infinite sequence of Seriously programs, each containing the previous program repeated twice. Score: 3*3/infinity – Mego – 2016-01-14T08:15:05.917

Answers

3

Vitsy, 8 bytes, 8 distinct character, ∞ programs (score 0)

This is a simple proof in another stack-based language of Mego's comment.

'Drd3*Z1
' rd3*Z   Standard quine formula
 D     1  Increase the number of ones every output (output 1 will have 11,
          2: 111, 3: 1111, etc.)

Addison Crump

Posted 2016-01-14T06:28:58.543

Reputation: 10 763

3

Perl 5 - 34 bytes, 19 distinct characters, 10000000 programs (score 0.0000646)

$p="print q{$p}"for 1..1e7;print$p

The score can be lowered arbitrarily by increasing the constant 1e7, at the expense of taking longer and producing larger programs.

faubi

Posted 2016-01-14T06:28:58.543

Reputation: 2 599