Polycops and Robbers (Robbers' Thread)

4

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

FireCubez

Posted 2018-09-14T22:29:50.853

Reputation: 857

Answers

4

Foo, PotatoLatte's answer

puts "Hello World!"

Try it online!

Ah, the bane of cops and robbers, Foo.

Jo King

Posted 2018-09-14T22:29:50.853

Reputation: 38 234

2

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.

Jo King

Posted 2018-09-14T22:29:50.853

Reputation: 38 234