#11. Befunge 98, 102 bytes
#v;2^0;7||"<+0+0+0+<;n4
#v0#_q@
#>3N.
#|\w*
#8 ^1b0<
#|
#M`
print(None and 9or 1/2and 1or 5)
#jd5ki2
Prints:
- 1 in Python 3
- 2 in Vim - This takes quite a while to output for some reason...
- 3 in Minkolang v0.15
- 4 in ><>
- 5 in Python 2
- 6 in SMBF
- 7 in Japt
- 8 in Retina
- 9 in Perl
- 10 in Befunge 93
- 11 in Befunge 98
To be perfectly honest, I have no clue why the Vim code takes 1 min to output. Also, no clue how Retina works.
Explanation:
#v Skips the v, which would send the IP down
; Unlike '93, where ; is a no-op, '98 skips to the next ;
and doesn't execute anything in between
2^0; Not executed, unlike Befunge 93
7| Pushes 7 onto the stack, and then sends the IP up, because 7 is not 0
n0b1 n clears the stack, and #s are pushed until the stack is [0, 11, 1
*. multiplies the top 2 values of the stack to give 11, and prints it (yay!)
_ Sends the IP right, because the top value of the stack is 0
q Ends the program (no-op for '93, which continues to @)
Things to note:
- The
0
next to theb
isn't strictly necessary in the code's current state, and the stack has been cleared. It can be removed if necessary, but allows for other stack manipulation beforehand as part of a possible future program. - The
_q@
is there as part of Retina (It doesn't work without it, don't ask me why). The addition ofq
also lets the '98 code run at
operation, which splits the IP (along with making the Retina program print 8 instead of 7) - The
_
is not a simple>
because that would mess the SMBF part up.
Edit: Just realized that the _q@
should probably be @00
(Where 0s can be ~any char) to make the program more flexible in the future. I'm too lazy (and tired) to change all the links right now though. Will get around to it eventually...