9
1
You must make a polyglot that outputs its source code in one language and its source code backward in another. Unlike the normal rules, you are allowed to read the current file or use a builtin to get the source code of your submission and reverse that in one language. Your source code cannot be a palindrome.
For example, if your source code is abcxyz
, it must output abcxyz
in one language and zyxcba
in another. If your code is abcxyzyxbca
, it's invalid because it's a palindrome.
Good luck!
3Normal rules are there for a reason. Allowing quine built-ins will likely make this challenge too broad, and allowing palindrome source codes allows answers which are forward quines for both languages. – Erik the Outgolfer – 2017-04-24T11:43:39.600
@EriktheOutgolfer palindromes are now not allowed. – programmer5000 – 2017-04-24T11:44:58.760
Palindromes are not allowed What does that mean? Are you trying to forbid built-in functions that reverse their input, maybe? – Luis Mendo – 2017-04-24T11:50:24.417
@LuisMendo No I suggested that if palindromes are allowed then a forward quine+forward quine polyglot could be a valid answer (while not being the intention). Reverse functions aren't banned. – Erik the Outgolfer – 2017-04-24T11:51:26.980
1@EriktheOutgolfer Ah, so the source code cannot be a palindrome? – Luis Mendo – 2017-04-24T11:52:45.547
@programmer5000 Well, I don't think it's too broad anymore. – Erik the Outgolfer – 2017-04-24T11:52:45.710
@LuisMendo Yeah, I'll clarify and add an example in there. – Erik the Outgolfer – 2017-04-24T11:53:14.903
@programmer5000 Are different versions of a language considered the same language or not? – Erik the Outgolfer – 2017-04-24T11:57:33.880
@LuisMendo you are correct. – programmer5000 – 2017-04-24T12:07:35.337
@ErikTheOutgolfer different versions of the same language are allowed. – programmer5000 – 2017-04-24T12:08:04.110
2I think you should offer a bounty for the first person to complete this challenge without breaking any of the normal quine rules. (maybe 50 rep?) – clismique – 2017-04-24T12:13:46.810
@Qwerp-Derp good idea. Maybe. – programmer5000 – 2017-04-24T12:15:39.607
1I read "in one language" as clearly disallowing the case where both languages read the source code, but the current top-voted answer does exactly that. Can you edit to make it clear whether that's meant to be allowed? – hvd – 2017-04-24T21:44:03.440