1
\$\begingroup\$

This question already has an answer here:

A polyglot is a program which can be run by several different language's interpreters/compilers without failing.

For example, the stackoverflow 404 page contains a polyglot which runs in Python, Perl, Ruby, C, brainfuck and befunge, each time printing 404 to stdout.

404

Now, my challenge is to create a polyglot which, when run as a certain language, will print:

Just Another #{Name Of Language} Hacker,

So, if you say that your program can be run as both JavaScript and ><>, when run in a JavaScript environment it should print

Just Another JavaScript Hacker,

and when run by a ><> interpreter,

Just Another ><> Hacker,

In your answers, you should list the number of languages which accept it as a valid program and produce correct output, as well as a list of those languages.

The program which runs under the most languages wins!

\$\endgroup\$

marked as duplicate by isaacg, jimmy23013, NinjaBearMonkey, Doorknob May 24 '15 at 19:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    \$\begingroup\$ @flawr it's an exact duplicate of the second dupe target though. If this was considered sufficiently different (which I don't think it is), I'd say the older challenge should be reopened. \$\endgroup\$ – Martin Ender May 24 '15 at 20:51