https://github.com/mame/quine-relay/blob/master/QR.rb Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + By Plan + Enterprise + Teams + Compare all + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} mame / quine-relay Public * * Notifications * Fork 556 * Star 12.6k * Code * Issues 15 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights Permalink master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags quine-relay/QR.rb / Jump to Code definitions [ ] Code navigation index up-to-date Go to file * Go to file T * Go to line L * Go to definition R * * Copy path * Copy permalink This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. @mame mame Replace Julia, Nim, and Pike with Kotlin and WebAssembly ... Latest commit 7b81d87 Apr 21, 2022 History ... to support Ubuntu 22.04. 2 contributors Users who have contributed to this file @mame @pczarn 65 lines (65 sloc) 15.7 KB Raw Blame Edit this file E Open in GitHub Desktop * Open with Desktop * View raw * * View blame This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters eval$s=%q(eval(%w(B=92.chr;g=32.chr;puts(eval(%q(N=10.chr;n=0;e=->s{Q [Q[s,B],?"].K(N,B+?n)};E=->s{'("'+e[s]+'")'};d=->s,t=?"{s.K(t){t+t}}; def~f(s,n)s.K(/.{1,#{n*255}}/m){yield$S=E[$s=$&]}end;Q=->s,t=?${s.K (t){B+$&}};R=";return~0;";V=->s,a,z{s.K(/( #{B*4})+/){a+"#{$&.size/2}"+z}};C=%w(System.Console~Write);$C=C*?.;$D ="program~QR";$G="~contents~of"+$F="~the~mix!g~bowl";$L= "public~static";$W="s.WriteByte";rp=->s,r{v="";[r.!ject(s){|s,j|o={}; m=n=0;s.size.times{|i|o[f=s[i,2]]||=0;c=o[f]+=1;m(p(3+ord~c);Z"-1~0~";c))#{E[~~~~~~% (object"Application"{state"ma!"{foreach(s~![#{f(%(puts~"#{Q[e[% (echo~'a::=`x7e#{Q[Q["let~s=#{E[%(void~p(!t[]c){foreach(!t~v~!~ c)stdout.Zf("%c%c",v/256,v%256);}void~mX{!t[]a;p ({19796,26724,0,6,0,1,480,19796,29291,#{s=%(module~QR;!itial~beg!~#{f ("let~s=#{E[%(Module~QR:Sub~MX:Dim~c,n,s~As~Object=#{C [0]}.OpenStandardOutput(),t()As~Short= {26,34,85,127,144,153,196}:For~Each~c~ !"BasmCBBBCRE`x60F<<<D`x21BE@ABRCABRCABRCA`x4a `x21CE@~B-BB~CACk:CvACqRC~COBMADRCACRCADRCABRCABRC~BACj:B-BBOBMADRCADRCADRCA FRCMM}CBABM`x7e#{40.chr}BBBCBBB,BBBDBBB0BBBDBBB4BBB=BBB?BBB;BBB~...^ t..^n..(module(import:wasi_snapshot_preview1::fd_H:(func (param~i32~i32~i32~i32)(result~i32)))(memory(export:memory:)(data~:^ 08^00^00^00$:))(func(export:_start:)i32.const~1~i32.con st~0~i32.const~1~i32.const~0~call~0~drop))":c=Asc(c):If~c=36:For~c= 0To~11:#$W(If(c~Mod~3,Asc(#{s="<#{U="xsl:template"}~match='/'><`x21[ CDATA [#{% (sub~f(s$,n)Z(s$);:for~i=1to~n~Z("Y");:next:end~sub:f("#{V[e[% (H,format="#{y="";f("^H{-}{txt}{#{Q["echo~-E~$'#{Q[Q[E[% (with~Ada.Text_Io;procedure~qr~is~beg!~Ada.Text_Io.Put( "#{d[%(trans~B(Buffer)`ntrans~O(n){`nB:add(Byte(+~1 28~n)) }`nt rans~f(v ~n){`nO(+(/~n~64)107)`nO(n:mod~64)`nO~v}`ntrans~D(n){if (<~n~4){f(+(*~6~n)9)48}{if(n:odd-p){D(-~n~3)`nf~27~48`nf~36~11}{D(/ ~n~2)`nf~21~48`nf~48~20}}}`ntrans~S(Buff er"#{e[%W[STRINGz:=~226+~153,a:=z+~166,b:=a+"2"+z +~1 6 0,c:= b+"8"+z+~165,t:="#{d[%(class~QR{#$L~void~ma!(SJ[]a){a=#{E["H('#{Q[e ["implement~ ma!0()=Z"+E["BEGIN{Z#{E[%(echo~'#{%(f(s){System.out.Z (s);}s="38 9**6+44*6+00p45*,";for(c:#{E[(s="#!clude`n!t~mX{std::cout <<#{E[%(class~Program{#$L~void~MX{#$C("Qu!e~R elay~Coffee.^n^ nIngredients.^n");for(!t~i=9;i++<126;)#$ C($"{i}~g~caffe!e~{i}^n");#$C("^nMethod.^n"); foreach(char~c~!#{E[% ((doseq[s(lazy-cat["IDENTIFICATION~DIVI SION.""PROGRAM-ID.~QR.""PROCEDURE~DIVISION."'DISPL A`x59](map~#(str"~~~~^""(.replace~%1"^"""^"^ "")"^"")(re-seq~#". {1,45}""#{e["(f=(n)->Array(n+1 ).jo!~'Y');console.log('%s',#{V[E[% ((H-l!e"#{e ["import~std.stdio;void~mX{H(`x60#{%(method ~MX{Z(@"#{d["['']p[# {"IO.puts"+E[%((pr!c~" #{e["`nma!(_)->`nio:fH#{d[E['Zfn("""'+d[?"+ "%option~noyywrap`n%%`n%%`n!t~mX{puts#{E[ "echo~'#{Q[Q[%(~:~A~."# {g*9}"~;~:~B~A~."~ WRITE(*,*)'"~A~;~:~C~B~T`x59PE~."~'"~CR~ ;~:~D~S"~#$D"~C~S^"~Z~^"(&"~C~S^"~#{e[% (Z"# {e["s:=OutputTextUser(); WriteAll(s ,#{E[%(Zf"#{e[ d[f(".template~1`n#{d['set~Z"-";Z'+E[ %(package~ma!;import"fmt";func~mX{fmt. Pr!t# {E[%(236:j;{119:i; {206i-:i;. 48<{71+}{[i]^48-*}if}%}:t;"a lgoritmo~QR;!"[195][173] ++'cio~impri ma("'"013141"t"/12131"t~6*"/1:1918151 :??6 271413/4=3626612/2/ 35325121 5/`x5a0`x5a0R"t"#{e[%(z=new~java.util. zip.G `x5aIPOutputStream(System.out );z.H('#{"ma!=putStr"+E["class~QR{#$L ~function~mX{neko.Lib. Z#{E[% (procedure~mX;i: =c:=0;s:=#{E[%(.class~public~QR`n.super~#{$T ="java/ io/Pr!tStream"}`n.method~ #$L~ma!([L#{S="java/lang/S"}J;)V~;]`n .lim it~stack~2`ngetstatic~#{S} ystem/ou t~L#$T;`nldc~"#{e [%(class~QR{#$L~void~ma!(SJ[]v){SJ~c[]= new~SJ[9999 9],y="",z=y,s="#{z=t=(0..r=q=12 6).map{|n|[n,[]]};a="";b=->n{a<<(n%78+5 5)%84+42};(%(P={0:'[+[]]',m:' ((+[])'+(C="['constr uctor']")+"+[ ])['11']"};for(R~!~B=('`x21[]@`x21 `x21[]@[][[]]@'+(A=" []['fill']")+"@([]+[])['fontc olor']([])@(+('11e20')+[])['split']( [])@"+A+C+"('return~escape')() ("+A+')').split('@')) for(E~!~D=ev al(G='('+B[R]+'+[])'))P[T=D[E]]=P [T]||G+"['"+E+"']";for(G= '[',B=0;++B<36;)P[D=B.toSJ(3 6)]=B<10?(G+='+`x21+[]')+']':P[D] ||"(+('"+B+"'))['to'+([]+[])"+C+" ['name']]('36')";A+=C+" ('consol e.log(unescape(^"";for(E~!~G=#{E ["fun~ma!(a:Array){Z#{Q[E [%(s=();a(){~s+=($(echo~-n~ $1|od~-An~-tu1~-v)~$2);};a~"Sect ion`x48eader+name:=QR; SectionPublic-ma!<-("~10;t='#{"console .log "+Q[E[%(@s=global[#{i=(s= %(`x48AI~1.2`nVISIBLE~"#{"x=sJ.K(#{V[E[" changequote(<@,@>)`ndef!e( p,<@#{"all:`n`t@echo~'#{d["l!e l:99999;Z#{E["solve~satisfy;output~[# {E[%(.assembly~t{}.method~ #$ L~void~MX{.entrypo!t~ldstr"#{e["m {{`x21:~x`nqr:~|-`n~:db`x60#{e[s="$Z#{E["Zf#{E ["#import# {N}!t~m X{puts#{E["Z_sJ"+E["s=double #{E["Z#{E["$console:l!e[#{"#$D(output); beg!~H(#{f((p="eval";%($_="# {s,v=r p["$_='#{Q[%($ z)&&$i/$z<($c<$w?ord($s[(!t)($c/ 3)]):$c-- %3+2)?$t[2].$t[$c%3%2].$ t[$c%3]:"^0^0^0":"^0")$c= $i%$z;foreach(array("I`x48DR".pack ("NNCV",$w+2,128,8,2),"IDAT".gzcompress($m ),"IEND")as$d)echo~pack ("NA*N",strlen ($d)-4,$d,crc32($d));).K (B,"`x7f"),?']}';s:g/^x7 f/Y/;Z~$_",128..287];s="$_='#{Q[s,c=/['Y]/]} ';$n=32;$s='#{Q[v,c]}';$s=`x7es{..} {$a=$&;$b=chr(--$n&255);`x7es/$b/ $ a/g;}eg;Z";(s+N*(-s.siz e%6)).unpack("B*")[0].K( /.{6}/){n=$&.to_i~2;((n+14)/26*6+n+47).chr}} ";s|.|$n=ord$&;substr~unpack(B8,chr$ n-!t($n/32)*6-41),2|eg;eval~pac k'B*',$_).scan(/[~,-:A- z]+|(.)/){p="s++#{$1?"c hr~#{$1.ord}+e":$&+?+};"+p};p),1){"'#$s',"}} '')end.".K(/[:;()]/){?`x5e+$&}}]"]};qu it"]};t=num2cell(b=11-ceil( s/ 13));for~n=1:9m={};fo r~i=1:141f=@(x,y,n)repm at(['Ook'~char(x)~'~Ook'~char(y)~'~'],[1~abs (n)]);m(i)=[f(z=46,63,n)~f(q=z-(i<13)*1 3,q,i-13)~f(33,z,1)~f(63 ,z,n)];end;t(x=b==n)=m(d iff([0~s(x)])+13);end;Z f('%%s',t{:})"]]+R}}"]}`n"]};"]}`x60 `n~global~_start`n~_start:mov~edx,#{s.size}`n~ m ov~ecx,m`n~mov~ebx,1 ` n~mov~eax,4`n~!t~128`n~m ov~ebx,0`n~mov~eax,1`n~ !t~128`nx:~|`n~}}{{{qr}}}"]}"call~void~ [mscorlib]#{C*"::"}(sJ)ret})]}];"]};quit( ); ",?$].K(?' ){"' ^''"}} '"}@>)`np"], ?&,?&]},'&(%d+)&',functi on(s)return~sJ.rep('Y', tonumber(s))end);Z(x)".K(/[:"]/,":^0")}"`n `x4bT`x48`x58B`x59E~B`x59E)).size+1}x ~ i8]c"#{s.K(/[ ^"`n`t]/){" ^ %02`x58"%$&.or d}}^00"declare~i32@puts(i 8*)def!e~i32@mX{%1=call~ i32@puts(i8*getelementptr([#{i}x~i8],[#{i} x~i8]*@s,i32~0,i32~0))ret~i32~0})], ? #].K(?',%('"'" '))}';for((i=0 ; i<${ #t};i+=99)); do;x=${t:$i:99};a~"^"${x/ /[Y^`"]/Y^0}^".Z;"~10;do ne;a~");";p(){~echo~-n~$1;};f(){~for~x~!~${s [*]};do;p~$3;for((j=$2;j--;)); do ;h~$1~$x~$j;done;done;};p~k^`x6 0;h (){~p~^`x 60${1:$(( $2>>$3&1)):2};};f~kki~7~'` x60`x60s`x60`x60s`x60`x60 s`x60`x60s`x60`x60s`x60`x60s`x60`x60s`x60 `x60si';s=();a~'AG-`x48-`x48Fy. IlD= =;=jdlAy=;=jldltldltl{lAulAy=jtl ldlAyFy=?=jdlAyG FyFyG2 AFy>zlAFFBCjldGyGFy>GFy.AGy =G==n`x48==nlldC=j@=jtlldl tldlAut11';h(){~p~${1:$(((($2%83-10)>> ((2-$3)*2))%4)):1};};f~ski^`x60 ~3)]]}~} "]})A+="'+`x21[] +'"+G.charCodeAt (E).toSJ(16);for(A+ ="^ ".replace(/'+`x21[]+'/g,^"%^ ")))')()",R=0;R<9;R++)A=A. replace(/'.*?'/g,function(B){T=[];for(E=1; B[E+1];)T.push(P[B[E++]] );return~T .jo!('+')});console.log ('"'+A+'"'))).bytes{|n|r,z=z[ n ]||(b[r/78];b[r];q<6083&&z[n] =[q+=1,[]];t[n])};b[r/78];b [r]}";!t~i=0,n=0,q=0;for(;++n<126;)c[n]= ""+(char)n;for(;i<#{a.s ize};){q=q*78+ (s.charAt(i)-13)%84;if(i++%2> 0){y=qn{L<<(n+ 62)%92+35;D};s.bytes{|c|n>0?n-=1:(t[c]=(t[ c]||[]).reject{|j|j 4&&x<<[ k,j]};x=x.max)?(n,j=x;x=b.size;(u=[x,3999].m! ;D[u%87][u/87];L<0;x=4001+ i-j;D[x%87][x/87][n-5]):b<`nchar*p=#{E[L]},s[999999],*q=s;!t~mX{!t~ n,m;for(;*p;){n= (*p-5)%92+(p[1]-5)%92*87;p+=2;if(n>3999)for(m=(*p ++-5)%92+6;m--;q++) *q=q[4000-n];else~for(;n--;)*q++=*p+ +;}puts(s)#{R}}")]}){s+="00g,";for(m=1;m<256;m*=2)s+="00 g,4,:"+(c/ m%2>0?"4+":"")+",";f(s);s="4,:,";}f(s+s);for(c:Base64.getDecoder().de code("kaARERE`x58/I0ALn3n5ef6l/Pz8+fnz58/BOf5/7/hE`x58/O`x5azM 5mC`x58/Oczm`x5azBPn5+`x58/OczMznBL/nM5m`x5azBPu++fPPOc5zngnnO`x5azO `x5agnBMGAW7A==")){c=c<0?256+c:c;for(i=0;i++<3;c/=8)f(c%8);f ("8*+8*+,");}f("@");).K(?',%('"'"'))}'|sed~-e's/Y/YY/g'~-e's/"/Yq/ g'~-e's/.*/Z~"&"^nquit/')]}}"]],?']}');".K(/^+/){"`x5 e#{$&.size}`x5e"}]}.split("Y`x5e");for(!t~i=1;i";s.size*16+3}.ToSJ("x8") (1`x58or~7-c*2^3)),92)):Next:Else:n=(c>124)*(8*c-# {s.size+1289}):Do~While~n>127:#$W(128+(127And~n)):n^=128:Loop:#$W(If (c<125,If((c-1)^7-8,c+66*(c>65And~c<91),t(c-57)),n)):End~If: Next:For~Each~c~!"#{d[s].K~N,'"&~VbLf~&"'}":#$W(Asc (c)):Next:End~Sub:End~Module)]}`nput=s`nZ`nqa`x21",3){%($H("%s",# $S);)+N}}end~endmodule);W=s.size*72+4;"%d,%d"%[W/65536,W%65536]}}); foreach(!t~c~!#{E[s]}.data)foreach(!t~v~!~a={0,9,7,4,5,c/100*7/6 +1,c%100/10*7/6+1,c%10*7/6+1,7})p({144,v=15450+v*256,384,v});p ({255,12032});})]},i=0,t='k';while(s[i])t='^x60.'+s[i++]+t; console.log(t)",B],?`x21].K(?',%('"'"'))}'"^n::=^na")],/[`[`]$]/]} "),4){$S+?,}}])Console.H(s);Application.exit();}})]};Z"0~0~- 1");)],?']}';cr",127..255];f(%(variable~s=`x60#{s.K(/.{1,234}/){$&.K ("`x60",%(`x60+"`x60"+`x60))+"`x60+`n`x60"}}`x60,i;for(i=0;i<129;i++) s=strreplace(s,pack("C",255-i),substrbytes(`x60#{v[0,99]}`x60+`n`x60# {v[99..-1]}`x60,i*2+1,2));Zf("%s",s)),7){ "f('%s')`n"%$s.unpack("`x48*")}}Zf("^n#[Exeunt]");quit)]}")),196){%(Z #$S;)}}}"]});})).gsub(/[!HJKXYZ^`~]/){[B*2,:write,B,:tring,:gsub,"ain ()",B*4,:print,g,:in][$&.ord%47%12]})))*"")# _buffer_for_future_bug_fixes_#_buffer_for_future_bug_fixes_#_buff ##################################################################### ############### Quine Relay -- Copyright (c) 2013, 2014 Yusuke Endoh (@mametter), @hirekoke ############################################## #####################################) * Copy lines * Copy permalink * View git blame * Reference in new issue [ ] Go Footer (c) 2022 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.