Palindromic Quine by mrpingouin

open String open Printf let q=char_of_int 34 let q=make 1 q let rev s=let s=copy s in let l=length s in for i=0 to l/2-1 do let j=l-i-1 in let x,y=get s i,get s j in set s i y;set s j x done;s let e=Array.make 0"" let e=Array.to_list e let f x=let a,f=concat q x,sprintf"%S"in let l=List.map f x in let b=concat"::"l in let s=sprintf"%s%s::e in f a"a b in let r=rev s in printf"%s;;exit 0;;0 tixe;;%s"s r;;let a="open String open Printf let q=char_of_int 34 let q=make 1 q let rev s=let s=copy s in let l=length s in for i=0 to l/2-1 do let j=l-i-1 in let x,y=get s i,get s j in set s i y;set s j x done;s let e=Array.make 0"::""::" let e=Array.to_list e let f x=let a,f=concat q x,sprintf"::"%S"::"in let l=List.map f x in let b=concat"::"::"::"l in let s=sprintf"::"%s%s::e in f a"::"a b in let r=rev s in printf"::"%s;;exit 0;;0 tixe;;%s"::"s r;;let a="::e in f a;;exit 0;;0 tixe;;a f ni e::"=a tel;;r s"::"s%;;exit 0;;0 tixe;;s%"::"ftnirp ni s ver=r tel ni b a"::"a f ni e::s%s%"::"ftnirps=s tel ni l"::"::"::"tacnoc=b tel ni x f pam.tsiL=l tel ni"::"S%"::"ftnirps,x q tacnoc=f,a tel=x f tel e tsil_ot.yarrA=e tel "::""::"0 ekam.yarrA=e tel s;enod x j s tes;y i s tes ni j s teg,i s teg=y,x tel ni 1-i-l=j tel od 1-2/l ot 0=i rof ni s htgnel=l tel ni s ypoc=s tel=s ver tel q 1 ekam=q tel 43 tni_fo_rahc=q tel ftnirP nepo gnirtS nepo"=a tel;;r s"s%;;exit 0;;0 tixe;;s%"ftnirp ni s ver=r tel ni b a"a f ni e::s%s%"ftnirps=s tel ni l"::"tacnoc=b tel ni x f pam.tsiL=l tel ni"S%"ftnirps,x q tacnoc=f,a tel=x f tel e tsil_ot.yarrA=e tel ""0 ekam.yarrA=e tel s;enod x j s tes;y i s tes ni j s teg,i s teg=y,x tel ni 1-i-l=j tel od 1-2/l ot 0=i rof ni s htgnel=l tel ni s ypoc=s tel=s ver tel q 1 ekam=q tel 43 tni_fo_rahc=q tel ftnirP nepo gnirtS nepo

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page