4
\$\begingroup\$

This is the robbers' thread, the cops' thread is here


A polyglot is a program, that without modification, can run in multiple languages.


Robbers' Challenge

First, find a vulnerable cop's answer, then try to find languages that the submission works in, if you found any that weren't listed by the cop, then you just cracked their answer. Post an answer linking to the original answer and what languages you found it working on (it must do the same thing on each language). You can then leave a comment on their answer linking back to your answer on this thread.


Winning

Most upvoted answer that actually does crack the cops' code wins

\$\endgroup\$

3 Answers 3

4
\$\begingroup\$

Foo, PotatoLatte's answer

puts "Hello World!"

Try it online!

Ah, the bane of cops and robbers, Foo.

\$\endgroup\$
2
\$\begingroup\$

Befunge-93, Shieru Asakotu's answer

'<?php '//'; #@ SPELL,WITH,ME, ,H,E,L,L,O, ,W,O,R,L,D,"'Hello, World!'"
$a = "'Hello, World!'";
if ([])
 console.log($a); //This should be an easy one to solve
else {
 for ($i = 1; $i < strlen($a) - 1; $i++)
  echo($a[$i]);
}
// ?>'

Try it online!

Prints 'Hello, World!', quotes included.

\$\endgroup\$
0
\$\begingroup\$

Perl 6, Julia 0.4, R, etc., Cortex's answer

#|
print("Hello, World!")# w|#(write-line "Hello, World!")

Try Perl online!

Try R online!

Try Julia 0.4 online!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.