5
\$\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

asked Sep 14, 2018 at 22:29
\$\endgroup\$

3 Answers 3

4
\$\begingroup\$

Foo, PotatoLatte's answer

puts "Hello World!"

Try it online!

Ah, the bane of cops and robbers, Foo.

answered Sep 20, 2018 at 23:26
\$\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.

answered Sep 15, 2018 at 2:07
\$\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!

answered Mar 28, 2020 at 7:42
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.