Build a polyglot for Hello World
print("Hello World!")
Works in at least Julia, Perl, PHP, Python2, Python3, Qbasic, R, Ruby ...
JavaScript ES6, Oration, Vitsy, Minkolang score = 71.94703045766462
121 / 2^(3/4)
. Fun fact? I'm not trying to win, just to add as many languages as possible.
222 //X>"!dlroW olleH"Z
shush=0
alert("Hello World!")
sorry=`
listen
capture Hello World!`
$$$
=` >### .O$r"!"rXr<`
What Vitsy sees
"Well, I'm a 1D language, so... for now, only the first line counts."
222 //X>"!dlroW ,olleH"Z
222 push three twos
// divide twice
X> drop the result and carry on
"!dlroW ,olleH"Z standard Hello, World! program
Thanks for the cookie, Vitsy :3
What JavaScript ES6 sees
222 //X>"!dlroW ,olleH"Z
"Let's see... You put the number 222
and then put something in a comment. Alright, sure, I'll roll with that."
shush=0
"You made a variable. Noted."
alert("Hello, World!")
"Ah, I see where you're going with this. I'll display that."
sorry=`
listen
capture Hello, World!`
"Oo! A multiline string! Now we're talking, ES6 rulez, ES5 drools!"
(EOF)
"Well, I'm done. Peace out."
What Oration sees
222 //X>"!dlroW ,olleH"Z
"This wasn't on my notes...! Best not do anything."
shush=0
alert("Hello, World!")
sorry=`
"Oh, here's some extra notes."
listen
"Listen..."
capture Hello, World!`
"...Hello, World!"
(EOF)
"thinks Nothing more! Great, I'm done here. breathes deeply"
Minkolang explanation
(Too lazy to create narrative. Might do later, the code took a while.) Irrelevant code replaced with #
or omitted. Also, added comments C ... C
.
222 ###>"!dlroW olleH"#
$$$ C this separates layers C
###>### #####.O$r"!"rXr<`
Layer 1, pt 1
222 ###>"!dlroW olleH"#
222 C push three 2s C
_ C space; fall to the next layer C
Layer 2, pt 1
###>### #####.O$r"!"rXr<`
> C go this way C
_ C fall to the next (first) layer C
Layer 1, pt 2
222 ###>"!dlroW olleH"#
>"!dlroW olleH" C go right and push those characters in that order C
_ C fall to the next layer C
Layer 2, pt 2
###>### #####.O$r"!"rXr<`
< C starts here, going left C
r C reverse stack C
X C pop n (n = 2), and pop top n items on stack (2, 2) C
r C reverse stack C
"!" C push exclamation mark (for some reason, it's chopped off C
r C reverse stack C
$O C output stack as characters C
. C terminate program C
'Hello World!'
Runs in several scripting languages, including PHP, GolfScript, APL, ...