25
4
Write a "palipolyquine": a program that is a quine, a polyglot, and a palindrome.
Rules:
- The number of polyglot languages is more preferable than code size.
- The shortest answer (in bytes) wins, in case of a tie.
- Polyglot and Quine rules see here: Write a Polyquine.
My example (I have a repository Freaky-Sources with tests):
C#/Java (1747 bytes):
/**///\u000A\u002F\u002A
using System;//\u002A\u002F
class Program{public static void//\u000A\u002F\u002A
Main//\u002A\u002Fmain
(String[]z){String s="`**?`@#_^using System;?_#^class Program{public static void?@#_^Main?_#main^(String[]z){String s=!$!,t=s;int i;int[]a=new int[]{33,94,38,64,35,95,96,63,36};String[]b=new String[]{!&!!,!&n!,!&&!,!&@!,!&#!,!&_!,!`!,!?!,s};for(i=0;i<9;i++)t=t.?@#_^Replace?_#replace^(!!+(char)a[i],b[i]);t+='*';for(i=872;i>=0;i--)t=t+t?@#_^[i];Console.Write?_#.charAt(i);System.out.printf^(t);}}/",t=s;int i;int[]a=new int[]{33,94,38,64,35,95,96,63,36};String[]b=new String[]{"\"","\n","\\","\\u000A","\\u002F","\\u002A","/","//",s};for(i=0;i<9;i++)t=t.//\u000A\u002F\u002A
Replace//\u002A\u002Freplace
(""+(char)a[i],b[i]);t+='*';for(i=872;i>=0;i--)t=t+t//\u000A\u002F\u002A
[i];Console.Write//\u002A\u002F.charAt(i);System.out.printf
(t);}}/*/}};)t(
ftnirp.tuo.metsyS;)i(tArahc.F200u\A200u\//etirW.elosnoC;]i[
A200u\F200u\A000u\//t+t=t)--i;0=>i;278=i(rof;'*'=+t;)]i[b,]i[a)rahc(+""(
ecalperF200u\A200u\//ecalpeR
A200u\F200u\A000u\//.t=t)++i;9<i;0=i(rof;}s,"//","/","A200u\\","F200u\\","A000u\\","\\","n\",""\"{][gnirtS wen=b][gnirtS;}63,36,69,59,53,46,83,49,33{][tni wen=a][tni;i tni;s=t,"/}};)t(^ftnirp.tuo.metsyS;)i(tArahc.#_?etirW.elosnoC;]i[^_#@?t+t=t)--i;0=>i;278=i(rof;'*'=+t;)]i[b,]i[a)rahc(+!!(^ecalper#_?ecalpeR^_#@?.t=t)++i;9<i;0=i(rof;}s,!?!,!`!,!_&!,!#&!,!@&!,!&&!,!n&!,!!&!{][gnirtS wen=b][gnirtS;}63,36,69,59,53,46,83,49,33{][tni wen=a][tni;i tni;s=t,!$!=s gnirtS{)z][gnirtS(^niam#_?niaM^_#@?diov citats cilbup{margorP ssalc^#_?;metsyS gnisu^_#@`?**`"=s gnirtS{)z][gnirtS(
niamF200u\A200u\//niaM
A200u\F200u\A000u\//diov citats cilbup{margorP ssalc
F200u\A200u\//;metsyS gnisu
A200u\F200u\A000u\///**/
2Are there any rules involved in making the poly-quine? Any limitations? If this question is as-is, then a possible (trivial) solution is
1
(which will output1
in many languages here, and is palindromic). – clismique – 2016-09-15T11:39:40.500I added more formal rules. – Ivan Kochurkin – 2016-09-15T11:48:07.397
2Ah, cool. Well, good luck on your first challenge! Just some more things though: you don't really need the code block there, and you should probably migrate the rules from the other challenge over to here. – clismique – 2016-09-15T11:52:20.073
1Does a 5-language, 999-byte answer beat a 4-language, 100-byte answer? – ETHproductions – 2016-09-15T13:15:05.163
@ETHproductions, I think yes. It's harder to add new language than reduce number of lines. – Ivan Kochurkin – 2016-09-15T13:20:51.197
i say that 100 bytes solutions in too high languages are 1000 times slower than the C or assembly one 999 bytes – RosLuP – 2016-09-15T17:01:53.557
Just a suggestion...What about Help, WarDoq! as one language? At least with
– geisterfurz007 – 2016-11-17T07:06:17.020Q
it outputs itself and ignores a lot of characters that might be used in other languages.