The Versatile Integer Printer Write a piece of code that is executable in at least three different languages. The code must output the integer 1 in language number one, 2 in language number two, 3 in language number three etc.

Rules:


The output must be only the integer, but trailing newlines are OK. 
The code can't take input of any kind
Different major versions of the same language are considered unique. So, your code can be executable in Python 2 and Python 3, however Python 2.5 and Python 2.7 are not considered unique.
You may use a new language if and only if it has an esolang/wiki article, available interpreter and documentation, and has been used by at least two users on PPCG prior to using it in this challenge. It must also adhere to these 4 rules.


The score of your submission is the number of bytes in your code divided by the number of languages it can run in cubed. So, a 54 byte solution that is executable in 3 languages will have a score of 2:

54 / 3^3 = 2  


Lower score is better.
15 languages, 68 66 65 bytes / 15^3 = 0.019...

Retina, Starry, Prelude, ETA, Axo, Labyrinth, Hexagony, Foo, Brian &amp; Chuck, Gol>&lt;>, evil, Whitespace, Fission, >&lt;> and GolfScript.

After a massive rewrite, I managed to fit in four more languages. The code contains the few tabs for Whitespace. Since Stack Exchange converts them to spaces, I've represented them with \t below:

#I5aeeNTH{\?      \t\t + +3;n@"8"ea9
15}7'`--~!@&lt;"31"LSOe.\t
 \teaww`


I think I'm done adding languages (although adding only one might save some bytes in what I already have). I wonder if it's golfable though... 65 bytes for 15 languages is quite a jump from 32 bytes for 11 languages, and I've now got at least one useless character in there to make Foo work..

Retina prints 1

Try it online.

Luckily, the first line is a valid regex. However that regex obviously doesn't match the empty input, so the first stage (consisting of the first two lines) doesn't do anything.

The third line is on its own, so it's treated as a Match stage which, by default, counts the number of matches. However, the ` is a separator which tells Retina that the part in front of it is a configuration string (it doesn't happen to know any of the options given there) and the part after it is the regex. So the regex is empty and Retina finds exactly one match.

Starry prints 2

Try it online.

Starry ignores everything except spaces and +*,'`.. Each command is one of those characters in conjunction with the spaces since the last of those characters. So let's remove all the extraneous code:

       + +'`. `


Seven spaces followed by + pushes a 2. One space followed by a + duplicates it. ' is a conditional jump. It pops the top of the stack, which is truthy (positive), so it jumps to the corresponding label (where labels are indicated by ` and "corresponding" means "with the same number of leading spaces"), which is the first `. . without spaces in front of it then prints the top of the stack as a number.

Prelude prints 3

Try it online.

This assumes the Python interpreter which uses numeric output. Let's remove all the no-ops:

# 5        ?         + +3    8   9
15 7  -- !   31


The first voice does a bunch of stuff, but nothing of it matters, because there is no ! to print any of the results. The second voice pushes a 1, then a 5, then a 7. We take the difference of the last two to get -2, and then subtract that from the 1 to get 3. ! prints it. The third voice has only no-ops.

ETA prints 4

Try it online.

ETA ignores everything except the characters ETAOINSH (in any case). So the code as seen by ETA is:

IaeeNTHneaSOeea


I tries to read input but can't, so it pushes -1. a pushes the current line number plus 1, which is 2. e is divmod, which replaces those with 0 and 1 (or -1, I don't actually know, but it doesn't matter). The next e replaces both of them with 0.

Now the interesting part. NTHne is a base-7 number literal. N and e are just the delimiters, and the three digits are THN. That is 54 (where T is digit 1, H is 0 and n is 5). a pushes 2 once more. S subtracts it, resulting in 52 and O outputs it as a character (4). Now e tries divmod again, but the stack contains two zeroes, so the program terminates with an error (but doesn't pollute STDOUT while doing so).

Axo prints 5

Try it online.

This language was pretty much single-handedly responsible for the rewrite. I couldn't have the } on the first line because it would block for input in Axo (see revision history for what I'm talking about). For Axo, only this part of the code is relevant:

#I5aeeNTH{\


Luckily, Axo also has implicit 0s at the bottom of its stack, because # pops the top of the stack (to check if the next instruction should be skipped or not). The letters are all no-ops. Then 5 pushes a 5, { prints it, \ terminates the program. Quite simple, really.

Labyrinth prints 6

Try it online.

I'm truncating the code a bit, because the right half is never reached, and I'm also using t in place of \t, so that the columns line up correctly:

#I5aeeNTH{\
15}7'`--~!@
 teaww`


Now that letters, spaces and tabs are walls in Labyrinth, so the accessible code actually looks like this:

# 5      {\
15}7'`--~!@
      `


The instruction pointer will automatically follow that path. # pushes the depth of the main stack (0) and 15 turns it into a 15. } moves it off to the auxiliary stack, and we're not going to use it any more. That conveniently makes the top of the stack zero, so that the IP does not turn left onto the 5. 7 turns the zero into a 7, ' is a no-op. The ` is unary negation, so we get -7. Now - subtracts the -7 from the implicit 0 underneath making it 7. This time, the IP does turn right to the `, which is unary negation, so we get 7 again. The IP hits a dead end a turns around. The - does the same thing as before, so we get 7 once more. As the top of the stack is now positive, the IP turns right. There's another - which gives -7 again.  Then ~ is bitwise NOT, which gives 6 and ! prints it. That's just the right moment to do so, because now the stack is empty again such that the IP won't turn left onto the { but instead continues straight ahead into the @ which terminates the program.

Hexagony prints 7

Try it online.

The unfolded code looks like this:

     # I 5 a e
    e N T H { \
   ? + + 3 ; n @
  " 8 " e a 9 1 5
 } 7 ' - - ~ ! @ &lt;
  " 3 1 " L S O e
   . e a w w . .
    . . . . . .
     . . . . .


Normally, that would be a terrifying Hexagony program, but the characters actually in use are not too many. In fact they are pretty much the same as those used by Labyrinth and I think the way I differentiate between 5 and 6 is quite nice. :)

The top row can basically be ignored. # would normally switch to a different IP, but the current memory edge is 0, so it doesn't. The letters just set a fixed memory value, but we're not going to use it. After the end of the first row, control flow continues in the middle row (starting from the }, going right). The } moves to another memory edge. 7 sets that edge to 7. ' moves back to where we came from. - subtracts the memory edge we've just set to 7 from an unused memory edge (0), so we get -7. The next - does the same thing again, so it's a no-op. So far, quite similar to Labyrinth (apart from the memory layout). But now ~ is not bitwise NOT but unary negation in Hexagony. So this gives 7 instead of 6. !@, like in Labyrinth prints the value and terminates the program.

Foo prints 8

Try it online.

As we all know since The Programming Language Quiz printing things is quite trivial in Foo, even if most of the code is a random jumble of characters. None of the characters affect the output except the "8" which prints 8. Well, there is the "31" later on, but Foo terminates with an error at the end of the first line. I'm not exactly sure why that happens, but it requires that 3 (or any other digit) on the top row, which isn't used anywhere else.

Brian &amp; Chuck prints 9

Try it online.

Let's do this thing again where we remove the third line (it's never parsed) and replace all irrelevant characters (i.e. no-ops, or cells that aren't read) with spaces:

         { ?         + +         9
  }   --   &lt;        .


Just as a reminder, each line is a Brainfuck-like whose tape is the source code of the other program. Control flow starts on the first line (called Brian).

The { moves the tape head all the way to the left (where it already is), and ? hands control flow over to Chuck (the second line). There, } moves the tape head to the right until it finds a zero cell. That doesn't happen until the end of the program, so the tape head ends up one cell after the 9. - decrements that cell, but that's irrelevant. &lt; moves the tape head onto the 9 and . prints it. Chuck runs out of program and terminates.

Gol>&lt;> prints 10

Tested here.

# is a mirror, so the IP immediately skips to the end of the first line (and goes left). The 9 can be ignored. a pushes 10, e pushes 14, "8" pushes the character code of 8, @ rotates the top three stack elements (pulling up the 10), such that n prints the 10 and ; terminates the program.

Thanks to Sp3000 for suggesting to use @ instead of ! (which saved a byte).

evil prints 11

Thanks to Sp3000 for sending me some brute-forced command-lists to generate single-digit numbers.

Try it online.

evil ignores everything except lower case letters so the code looks like this:

aeeneaeeaww


Also, n affects some state we don't care about so let's ignore that as well. Now a increments the register (which starts at 0), and e is evil's magic "weave" operation which permutes the bits in a particular way. aeeeaeea happens to yield the value 49 which is the character code of 1. ww prints it twice.

Whitespace prints 12

Try it online.

Okay, we know Whitespace only reads spaces, tabs and linefeeds, so let write the code as seen by Whitespace with STL:

SSSSSSTTSSLTLST


That's two commands:

SSSSSSTTSSL
TLST


The first one pushes the number 12. Specifically, SS starts a number literal. The next S is the sign bit (positive). Then everything up to the L is a binary representation of the number. There's a ton of leading zeroes, which we need for Starry, but they don't affect the number. Then the TTSSs is 12 in binary. Fun fact: if I added a 16th language, I could save a byte here, because Starry could use the four S in the binary represtation of 16. I doubt I will though...

The TLST just prints the top of the stack as a number. (TL marks the command as an I/O command, and ST is printing numbers.)

Fission prints 13

Try it online.

Fission only sees this part of the code:

           &lt;"31"L


L starts control flow with a left-going atom. " toggles print mode, so that 31 just prints 13. Then the atom is captured in the wedge of the &lt;, which terminates the program.

>&lt;> prints 14

Tested here.

Distinguishing between >&lt;> and Gol>&lt;> isn't as easy as I thought, because Gol>&lt;> almost always does the same thing as >&lt;> for commands that exist in both, and commands that only exist in Gol>&lt;> cause >&lt;> to crash. However, @ rotates the other way round in >&lt;>, such that it pushes down the 7 instead of pulling up the 10, and then the 14 gets printed instead of the 10.

GolfScript prints 15

Try it online.

This one is simplest: # comments out the first line. Then 15 pushes itself and } is a "super comment", which ignores the entire rest of the program. So the 15 is printed at the end of the program.