q=1//2;s=+0;s|0;"/.__id__;#";_="""q=1//2;s=+0;q|0;"2;s=+0;s|0;"/.__id__;#";_={0}{1}{0};R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q={0}{2}{0};print(_.format(Q,_,q[0:-12]+R,"%"))""";R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q="""|;#<?ob_end_clean();
eval($_='"$t"$_='"$t"?0?[$q=37 .chr+113 .chr+38 .chr,$p=(96 .chr+39 .chr)*4,$n=10 .chr,$s=39 .chr*12,$S=34 .chr*3]:eval("printf=console"printf=console.log;c=String.fromCharCode;$q=c(96);$p=c(37,113,38,39).repeat(4);$n=c(10);$s=c(39).repeat(12);$S=c(34,34,34)""):[]?[$q=q(!g)^PA,$p=HARHARHARHAR^od2od2od2od2,$n=R^X,$s=bbbbbbbbbbbb^EEEEEEEEEEEE,$S=hhh^JJJ]:[$q=O^h,$p=str_repeat(RHa3^w9GS,4),$n=R^X,$s=str_repeat(b^E,12),$S=HHH^jjj];//#');printf($x='q=1//2;s=+0;s|0;"2;s=+0;s|0;"/.__id__;#";_=%7$sq=1__id__;#";_=%7$sq=1//2;s=+0;q|0;"2;s=+0;s|0;"/.__id__;#";_=__id__;#";_={0}{1}{0};R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q={0}{2}{0};print(_.format(Q,_,q[0:-12]+R,"%8$s""%8$s"))%7$s;R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q=%7$s|;#<?ob_end_clean();%5$seval($_=%3$s%1$s%3$s);printf($x=%3$s%2$s%3$s,$_,$x,$q,$p,$n,$s,$S,"%8$s""%8$s",!0&&![]||([]+[])?$n:"""");//#%4$s%6$s%7$s;print(_.format(Q,_,q[0:-12]+R,"%8$s""%8$s"))%9$s',$_,$x,$q,$p,$n,$s,$S,"%""%",![]||([]+[])?$n:"""");//#`q&%`q&%`q&%`q&%''''''''''''""";print(_.format(Q,_,q[0:-12]+R,"%"))
Validate Perl, Ruby, PHP, Python 2 and Python 3 online! Validate Perl, Ruby, PHP, Python 2 and Python 3 online!
q=1//2;s=+0;s|0;"/.__id__;#";_="""q=1//2;s=+0;q|0;"/.__id__;#";_={0}{1}{0};R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q={0}{2}{0};print(_.format(Q,_,q[0:-12]+R,"%"))""";R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q="""|;#<?ob_end_clean();
eval($_='"$t"?0?[$q=37 .chr+113 .chr+38 .chr,$p=(96 .chr+39 .chr)*4,$n=10 .chr,$s=39 .chr*12,$S=34 .chr*3]:eval("printf=console.log;c=String.fromCharCode;$q=c(96);$p=c(37,113,38,39).repeat(4);$n=c(10);$s=c(39).repeat(12);$S=c(34,34,34)"):[]?[$q=q(!g)^PA,$p=HARHARHARHAR^od2od2od2od2,$n=R^X,$s=bbbbbbbbbbbb^EEEEEEEEEEEE,$S=hhh^JJJ]:[$q=O^h,$p=str_repeat(RHa3^w9GS,4),$n=R^X,$s=str_repeat(b^E,12),$S=HHH^jjj];//#');printf($x='q=1//2;s=+0;s|0;"/.__id__;#";_=%7$sq=1//2;s=+0;q|0;"/.__id__;#";_={0}{1}{0};R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q={0}{2}{0};print(_.format(Q,_,q[0:-12]+R,"%8$s"))%7$s;R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q=%7$s|;#<?ob_end_clean();%5$seval($_=%3$s%1$s%3$s);printf($x=%3$s%2$s%3$s,$_,$x,$q,$p,$n,$s,$S,"%8$s",!0&&!([]+[])?$n:"");//#%4$s%6$s%7$s;print(_.format(Q,_,q[0:-12]+R,"%8$s"))%9$s',$_,$x,$q,$p,$n,$s,$S,"%",![]||([]+[])?$n:"");//#`q&%`q&%`q&%`q&%''''''''''''""";print(_.format(Q,_,q[0:-12]+R,"%"))
q=1//2;s=+0;s|0;"/.__id__;#";_="""q=1//2;s=+0;s|0;"/.__id__;#";_={0}{1}{0};R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q={0}{2}{0};print(_.format(Q,_,q[0:-12]+R,"%"))""";R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q="""|;#<?ob_end_clean();
eval($_='"$t"?0?[$q=37 .chr+113 .chr+38 .chr,$p=(96 .chr+39 .chr)*4,$n=10 .chr,$s=39 .chr*12,$S=34 .chr*3]:eval("printf=console.log;c=String.fromCharCode;$q=c(96);$p=c(37,113,38,39).repeat(4);$n=c(10);$s=c(39).repeat(12);$S=c(34,34,34)"):[]?[$q=q(!g)^PA,$p=HARHARHARHAR^od2od2od2od2,$n=R^X,$s=bbbbbbbbbbbb^EEEEEEEEEEEE,$S=hhh^JJJ]:[$q=O^h,$p=str_repeat(RHa3^w9GS,4),$n=R^X,$s=str_repeat(b^E,12),$S=HHH^jjj];//#');printf($x='q=1//2;s=+0;s|0;"/.__id__;#";_=%7$sq=1//2;s=+0;s|0;"/.__id__;#";_={0}{1}{0};R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q={0}{2}{0};print(_.format(Q,_,q[0:-12]+R,"%8$s"))%7$s;R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q=%7$s|;#<?ob_end_clean();%5$seval($_=%3$s%1$s%3$s);printf($x=%3$s%2$s%3$s,$_,$x,$q,$p,$n,$s,$S,"%8$s",![]||([]+[])?$n:"");//#%4$s%6$s%7$s;print(_.format(Q,_,q[0:-12]+R,"%8$s"))%9$s',$_,$x,$q,$p,$n,$s,$S,"%",![]||([]+[])?$n:"");//#`q&%`q&%`q&%`q&%''''''''''''""";print(_.format(Q,_,q[0:-12]+R,"%"))
Perl 5, Ruby, JavaScript (Chrome), PHP, 389Python 2 , Python 3 , 1206 bytes, score 466/3891206 = 1038.5295629820051416865671641791
eval($_='$q=0?34 q=1//2;s=+0;s|0;"/.chr: []?[]+[]?q__id__;#";_="""q=1//2;s=+0;q|0;"/.__id__;#";_={0}{1}{0};R=chr(!g(39,34)^PA : [1/2>0])*12;Q=chr($s=String(39,34)[1/2==0])*3;q={0}{2}{0};print(_.fromCharCodeformat(96+![$t=topQ,$t[629877585..toString_,q[0:-12]+R,"%"))""";R=chr(30(39,34)]=console.log][1/2>0]):chr*12;Q=chr((39,34);$p=0[1/2==0])*3;q="""|;#<?ob_end_clean(113);
eval($_='"$t"?0?[$q=37 .chr+113 .chr+38 .chr+96chr,$p=(96 .chr+39 .chr)*4:[]?[]+[]?hhUhhUhhUhhU^OJ5OJ5OJ5OJ5,$n=10 :.chr,$s=39 $s.fromCharCodechr*12,$S=34 .chr*3]:eval(34"printf=console.log;c=String.fromCharCode;$q=c(96);$p=c(37,113,38,39).repeat(4);$n=c(10);$s=c(39).repeat(12);$S=c(34,34,34)"):str_repeat[]?[$q=q(SIE0^q8cP!g)^PA,$p=HARHARHARHAR^od2od2od2od2,$n=R^X,$s=bbbbbbbbbbbb^EEEEEEEEEEEE,$S=hhh^JJJ]:[$q=O^h,$p=str_repeat(RHa3^w9GS,4);,$n=R^X,$s=str_repeat(b^E,12),$S=HHH^jjj];//#');printf($x='eval$x='q=1//2;s=+0;s|0;"/.__id__;#";_=%7$sq=1//2;s=+0;q|0;"/.__id__;#";_={0}{1}{0};R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q={0}{2}{0};print(_.format(Q,_,q[0:-12]+R,"%8$s"))%7$s;R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q=%7$s|;#<?ob_end_clean();%5$seval($_=%3$s%1$s%3$s);printf($x=%3$s%2$s%3$s,$_,$x,$q,$p,$n,$s,$S,"%8$s",!0&&!([]+[])?$n:"");//#%4$s'#%4$s%6$s%7$s;print(_.format(Q,_,q[0:-12]+R,"%8$s"))%9$s',$_,$x,$q,$p,$n,$s,$S,"%",![]||([]+[])?$n:"");//#`q&"`q&"`q&"`q&"#`q&%`q&%`q&%`q&%''''''''''''""";print(_.format(Q,_,q[0:-12]+R,"%"))
Validate Perl, Ruby and PHP online! Validate Perl, Ruby, PHP, Python 2 and Python 3 online!
This is pretty much a standard quine format where the calculation of the quote to use is a little different for each language: in Ruby "%q& is used, PHP uses ', JavaScript (Node.js) makes use of ` and Perl 5 utilises q(...). Because only the quotes change, the rest of the program is still executable and valid syntax in each language. Python 2 and 3 are wrapped around the previous program using """ for Python 2 and ''' for Python 3.
The resultant Perl program isn't aand Ruby programs aren't standard quinequines, additional q/%qs are added each iteration, but the first program returns correctly.
- Perl 5:
eval($_=q&...q&);printf($x=q&...q&,...);//#'"`'"`'"`'"`#'%`'%`'%`'%`''''''''''''"""... - Ruby:
eval($_="$_=%q&..."%q&);printf($x="$x=%q&..."%q&,...);//#q&`'q&`'q&`'q&`'#`'`'`'`'''''''''''''"""... - JavaScript (Chrome):
eval($_=`...`);printf($x=`...`,...);//#"q&'"q&'"q&'"q&'#%q&'%q&'%q&'%q&'''''''''''''"""... - PHP:
eval($_='...');printf($x='...',...);//#"q&`"q&`"q&`"q&`#`q&%`q&%`q&%`q&%''''''''''''"""... - Python 2:
..._="""...""";...q="""...''''''''''''""";print(_.format(Q,_,q[0:-12]+R,"%")) - Python 3:
..._='''...''';...q='''...""""""""""""''';print(_.format(Q,_,q[0:-12]+R,"%"))
I've re-worked this a lot, I hope I haven't missed anything key here. I still have quite a way to go to be anywhere near Jo King's score ...
Perl 5, Ruby, JavaScript (Chrome), PHP, 389 bytes, score 46/389 = 10.529562982005141
eval($_='$q=0?34 .chr: []?[]+[]?q(!g)^PA : ($s=String).fromCharCode(96+![$t=top,$t[629877585..toString(30)]=console.log]):chr(39);$p=0?(113 .chr+38 .chr+96 .chr+39 .chr)*4:[]?[]+[]?hhUhhUhhUhhU^OJ5OJ5OJ5OJ5 : $s.fromCharCode(34,113,38,39).repeat(4):str_repeat(SIE0^q8cP,4);//#');printf($x='eval($_=%3$s%1$s%3$s);printf($x=%3$s%2$s%3$s,$_,$x,$q,$p);//#%4$s',$_,$x,$q,$p);//#`q&"`q&"`q&"`q&"
Validate Perl, Ruby and PHP online!
This is pretty much a standard quine format where the calculation of the quote to use is a little different for each language: in Ruby " is used, PHP uses ', JavaScript (Node.js) makes use of ` and Perl 5 utilises q(...). Because only the quotes change, the rest of the program is still executable and valid syntax in each language.
The resultant Perl program isn't a standard quine, additional qs are added each iteration, but the first program returns correctly.
- Perl 5:
eval($_=q&...q&);printf($x=q&...q&,...);//#'"`'"`'"`'"` - Ruby:
eval($_="...");printf($x="...",...);//#q&`'q&`'q&`'q&`' - JavaScript (Chrome):
eval($_=`...`);printf($x=`...`,...);//#"q&'"q&'"q&'"q&' - PHP:
eval($_='...');printf($x='...',...);//#"q&`"q&`"q&`"q&`
Perl 5, Ruby, JavaScript (Chrome), PHP, Python 2 , Python 3 , 1206 bytes, score 66/1206 = 38.6865671641791
q=1//2;s=+0;s|0;"/.__id__;#";_="""q=1//2;s=+0;q|0;"/.__id__;#";_={0}{1}{0};R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q={0}{2}{0};print(_.format(Q,_,q[0:-12]+R,"%"))""";R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q="""|;#<?ob_end_clean();
eval($_='"$t"?0?[$q=37 .chr+113 .chr+38 .chr,$p=(96 .chr+39 .chr)*4,$n=10 .chr,$s=39 .chr*12,$S=34 .chr*3]:eval("printf=console.log;c=String.fromCharCode;$q=c(96);$p=c(37,113,38,39).repeat(4);$n=c(10);$s=c(39).repeat(12);$S=c(34,34,34)"):[]?[$q=q(!g)^PA,$p=HARHARHARHAR^od2od2od2od2,$n=R^X,$s=bbbbbbbbbbbb^EEEEEEEEEEEE,$S=hhh^JJJ]:[$q=O^h,$p=str_repeat(RHa3^w9GS,4),$n=R^X,$s=str_repeat(b^E,12),$S=HHH^jjj];//#');printf($x='q=1//2;s=+0;s|0;"/.__id__;#";_=%7$sq=1//2;s=+0;q|0;"/.__id__;#";_={0}{1}{0};R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q={0}{2}{0};print(_.format(Q,_,q[0:-12]+R,"%8$s"))%7$s;R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q=%7$s|;#<?ob_end_clean();%5$seval($_=%3$s%1$s%3$s);printf($x=%3$s%2$s%3$s,$_,$x,$q,$p,$n,$s,$S,"%8$s",!0&&!([]+[])?$n:"");//#%4$s%6$s%7$s;print(_.format(Q,_,q[0:-12]+R,"%8$s"))%9$s',$_,$x,$q,$p,$n,$s,$S,"%",![]||([]+[])?$n:"");//#`q&%`q&%`q&%`q&%''''''''''''""";print(_.format(Q,_,q[0:-12]+R,"%"))
Validate Perl, Ruby, PHP, Python 2 and Python 3 online!
This is pretty much a standard quine format where the calculation of the quote to use is a little different for each language: in Ruby %q& is used, PHP uses ', JavaScript (Node.js) makes use of ` and Perl 5 utilises q(...). Because only the quotes change, the rest of the program is still executable and valid syntax in each language. Python 2 and 3 are wrapped around the previous program using """ for Python 2 and ''' for Python 3.
The resultant Perl and Ruby programs aren't standard quines, additional q/%qs are added each iteration, but the first program returns correctly.
- Perl 5:
eval($_=q&...q&);printf($x=q&...q&,...);//#'%`'%`'%`'%`''''''''''''"""... - Ruby:
eval($_=%q&...%q&);printf($x=%q&...%q&,...);//#`'`'`'`'''''''''''''"""... - JavaScript (Chrome):
eval($_=`...`);printf($x=`...`,...);//#%q&'%q&'%q&'%q&'''''''''''''"""... - PHP:
eval($_='...');printf($x='...',...);//#`q&%`q&%`q&%`q&%''''''''''''"""... - Python 2:
..._="""...""";...q="""...''''''''''''""";print(_.format(Q,_,q[0:-12]+R,"%")) - Python 3:
..._='''...''';...q='''...""""""""""""''';print(_.format(Q,_,q[0:-12]+R,"%"))
I've re-worked this a lot, I hope I haven't missed anything key here. I still have quite a way to go to be anywhere near Jo King's score ...