My Quines are sometimes specialized for Japanese. But to attend RubyConf, I should write "global" Quines.
v=0000;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP
4ZojjV)O>qIH1/n[|2yE[>:ieC "%.#% :::##" 97N-A&Kj_K_><wS5rtWk@*a+Y5
yH?b[F^e7C/56j|pmRe+:)B "##% ::##########" O98(Zh)'Iof*nm.,$C5Nyt=
PPu01Avw^<IiQ=5$'D-y? "##: ###############" g6`YT+qLw9k^ch|K'),tc
6ygIL8xI#LNz3v}T=4W "# #. .####:#######" lL27FZ0ij)7TQCI)P7u
}RT5-iJbbG5P-DHB<. " ##### # :############" R,YvZ_rnv6ky-G+4U'
$*are@b4U351Q-ug5 " #######################" 00x8RR%`Om7VDp4M5
PFixrPvl&<p[]1IJ " ############:#### %#####" EGgDt8Lm#;bc4zS^
y]0`_PstfUxOC(q " .#############:##% .## ." /,}.YOIFj(k&q_V
zcaAi?]^lCVYp!; " %% .################. #. " ;s="v=%04o;ev"%
(;v=(v-($*+[45, ":####: :##############% : " ])[n=0].to_i;)%
360)+"al$s=%q#{ "%######. ######### " ;;"%c"%126+$s<<
126}";d.gsub!(/ "##########. #######% " |\s|".*"/,"");;
require"zlib"|| "########### :######. " ;d=d.unpack"C*"
d.map{|c|n=(n|| ":#########: .######: . " )*90+(c-2)%91};
e=["%x"%n].pack " :#######% :###### #: " &&"H*";e=Zlib::
Inflate.inflate( " ######% .####% :: " &&e).unpack("b*"
)[0];22.times{|y| " ####% %### " ;w=(Math.sqrt(1-(
(y*2.0-21)/22)**(; " .###: .#% " ;2))*23).floor;(w*
2-1).times{|x|u=(e+ " %## " )[y*z=360,z]*2;u=u[
90*x/w+v+90,90/w];s[( " #. " ;y*80)+120-w+x]=(""<<
32<<".:%#")[4*u.count(( " . " ;"0"))/u.size]}};;puts\
s+";_ The Qlobe#{" "*18+ ( "# :#######" ;"Copyright(C).Yusuke End\
oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
This quine turns 45 degrees when executed; thus, it will come around when executed eight times (see below). You can make it any-degree turn by giving an integer as an command-line argument.
v=0416;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP
4ZojjV)O>qIH1/n[|2yE[>:ieC ".#####%.#% " 97N-A&Kj_K_><wS5rtWk@*a+Y5
yH?b[F^e7C/56j|pmRe+:)B " .#####%##% :" O98(Zh)'Iof*nm.,$C5Nyt=
PPu01Avw^<IiQ=5$'D-y? " #####%###: #" g6`YT+qLw9k^ch|K'),tc
6ygIL8xI#LNz3v}T=4W " %######## #." lL27FZ0ij)7TQCI)P7u
}RT5-iJbbG5P-DHB<. " :####### ###" R,YvZ_rnv6ky-G+4U'
$*are@b4U351Q-ug5 " ###: : ####" 00x8RR%`Om7VDp4M5
PFixrPvl&<p[]1IJ " %#... #####" EGgDt8Lm#;bc4zS^
y]0`_PstfUxOC(q " %### .#####" /,}.YOIFj(k&q_V
zcaAi?]^lCVYp!; " :. %% .#####" ;s="v=%04o;ev"%
(;v=(v-($*+[45, " :####: :####" ])[n=0].to_i;)%
360)+"al$s=%q#{ " %######. " ;;"%c"%126+$s<<
126}";d.gsub!(/ " ##########. " |\s|".*"/,"");;
require"zlib"|| " ########### " ;d=d.unpack"C*"
d.map{|c|n=(n|| " :#########: " )*90+(c-2)%91};
e=["%x"%n].pack " :#######% " &&"H*";e=Zlib::
Inflate.inflate( " ######% " &&e).unpack("b*"
)[0];22.times{|y| " ####% " ;w=(Math.sqrt(1-(
(y*2.0-21)/22)**(; " .###: " ;2))*23).floor;(w*
2-1).times{|x|u=(e+ " %## " )[y*z=360,z]*2;u=u[
90*x/w+v+90,90/w];s[( " #. " ;y*80)+120-w+x]=(""<<
32<<".:%#")[4*u.count(( " . " ;"0"))/u.size]}};;puts\
s+";_ The Qlobe#{" "*18+ ( " .##### :#" ;"Copyright(C).Yusuke End\
oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
v=0341;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP
4ZojjV)O>qIH1/n[|2yE[>:ieC "#% .#####%." 97N-A&Kj_K_><wS5rtWk@*a+Y5
yH?b[F^e7C/56j|pmRe+:)B " : %#####%##. " O98(Zh)'Iof*nm.,$C5Nyt=
PPu01Avw^<IiQ=5$'D-y? " #####%###: " g6`YT+qLw9k^ch|K'),tc
6ygIL8xI#LNz3v}T=4W " %######## " lL27FZ0ij)7TQCI)P7u
}RT5-iJbbG5P-DHB<. " :####### " R,YvZ_rnv6ky-G+4U'
$*are@b4U351Q-ug5 " :### : " 00x8RR%`Om7VDp4M5
PFixrPvl&<p[]1IJ " %#... " EGgDt8Lm#;bc4zS^
y]0`_PstfUxOC(q " .###: " /,}.YOIFj(k&q_V
zcaAi?]^lCVYp!; " :. %% " ;s="v=%04o;ev"%
(;v=(v-($*+[45, " :####: " ])[n=0].to_i;)%
360)+"al$s=%q#{ " %######. " ;;"%c"%126+$s<<
126}";d.gsub!(/ " ##########" |\s|".*"/,"");;
require"zlib"|| "% ##########" ;d=d.unpack"C*"
d.map{|c|n=(n|| " :#########" )*90+(c-2)%91};
e=["%x"%n].pack " ########" &&"H*";e=Zlib::
Inflate.inflate( "#. ######%" &&e).unpack("b*"
)[0];22.times{|y| "## :####. " ;w=(Math.sqrt(1-(
(y*2.0-21)/22)**(; "#. .###: " ;2))*23).floor;(w*
2-1).times{|x|u=(e+ "% . %## " )[y*z=360,z]*2;u=u[
90*x/w+v+90,90/w];s[( " . #. " ;y*80)+120-w+x]=(""<<
32<<".:%#")[4*u.count(( " : " ;"0"))/u.size]}};;puts\
s+";_ The Qlobe#{" "*18+ ( "#. .##### " ;"Copyright(C).Yusuke End\
oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
v=0264;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP
4ZojjV)O>qIH1/n[|2yE[>:ieC "####% .####" 97N-A&Kj_K_><wS5rtWk@*a+Y5
yH?b[F^e7C/56j|pmRe+:)B "##### : .#####" O98(Zh)'Iof*nm.,$C5Nyt=
PPu01Avw^<IiQ=5$'D-y? "######. #####%" g6`YT+qLw9k^ch|K'),tc
6ygIL8xI#LNz3v}T=4W "####: . %######" lL27FZ0ij)7TQCI)P7u
}RT5-iJbbG5P-DHB<. "#### . :######" R,YvZ_rnv6ky-G+4U'
$*are@b4U351Q-ug5 "####% ###: " 00x8RR%`Om7VDp4M5
PFixrPvl&<p[]1IJ "### %#..." EGgDt8Lm#;bc4zS^
y]0`_PstfUxOC(q "## .. %###" /,}.YOIFj(k&q_V
zcaAi?]^lCVYp!; ":#. . :" ;s="v=%04o;ev"%
(;v=(v-($*+[45, ": : : " ])[n=0].to_i;)%
360)+"al$s=%q#{ "% %#: " ;;"%c"%126+$s<<
126}";d.gsub!(/ "#::#.: %#% " |\s|".*"/,"");;
require"zlib"|| " : :#% " ;d=d.unpack"C*"
d.map{|c|n=(n|| " :% : " )*90+(c-2)%91};
e=["%x"%n].pack " %###%% " &&"H*";e=Zlib::
Inflate.inflate( " ########. " &&e).unpack("b*"
)[0];22.times{|y| " ########. " ;w=(Math.sqrt(1-(
(y*2.0-21)/22)**(; " ##:%###. " ;2))*23).floor;(w*
2-1).times{|x|u=(e+ " %% . " )[y*z=360,z]*2;u=u[
90*x/w+v+90,90/w];s[( " . " ;y*80)+120-w+x]=(""<<
32<<".:%#")[4*u.count(( " " ;"0"))/u.size]}};;puts\
s+";_ The Qlobe#{" "*18+ ( "####. .###" ;"Copyright(C).Yusuke End\
oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
v=0207;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP
4ZojjV)O>qIH1/n[|2yE[>:ieC "#######% .#" 97N-A&Kj_K_><wS5rtWk@*a+Y5
yH?b[F^e7C/56j|pmRe+:)B "##########: : " O98(Zh)'Iof*nm.,$C5Nyt=
PPu01Avw^<IiQ=5$'D-y? "#############. " g6`YT+qLw9k^ch|K'),tc
6ygIL8xI#LNz3v}T=4W "############: . " lL27FZ0ij)7TQCI)P7u
}RT5-iJbbG5P-DHB<. "############# . " R,YvZ_rnv6ky-G+4U'
$*are@b4U351Q-ug5 "############## " 00x8RR%`Om7VDp4M5
PFixrPvl&<p[]1IJ "# %######### " EGgDt8Lm#;bc4zS^
y]0`_PstfUxOC(q " %#: %##: : " /,}.YOIFj(k&q_V
zcaAi?]^lCVYp!; " #. .:#. . " ;s="v=%04o;ev"%
(;v=(v-($*+[45, " : : : : " ])[n=0].to_i;)%
360)+"al$s=%q#{ " :% %#: " ;;"%c"%126+$s<<
126}";d.gsub!(/ " #::#.: %#% " |\s|".*"/,"");;
require"zlib"|| " : :#% " ;d=d.unpack"C*"
d.map{|c|n=(n|| " :% : " )*90+(c-2)%91};
e=["%x"%n].pack " .###%# " &&"H*";e=Zlib::
Inflate.inflate( " ########. " &&e).unpack("b*"
)[0];22.times{|y| " :######## " ;w=(Math.sqrt(1-(
(y*2.0-21)/22)**(; " ##:%###. " ;2))*23).floor;(w*
2-1).times{|x|u=(e+ " %% . " )[y*z=360,z]*2;u=u[
90*x/w+v+90,90/w];s[( " . " ;y*80)+120-w+x]=(""<<
32<<".:%#")[4*u.count(( " " ;"0"))/u.size]}};;puts\
s+";_ The Qlobe#{" "*18+ ( "#######. ." ;"Copyright(C).Yusuke End\
oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
v=0132;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP
4ZojjV)O>qIH1/n[|2yE[>:ieC ":::#######%" 97N-A&Kj_K_><wS5rtWk@*a+Y5
yH?b[F^e7C/56j|pmRe+:)B "################ : " O98(Zh)'Iof*nm.,$C5Nyt=
PPu01Avw^<IiQ=5$'D-y? "####################. " g6`YT+qLw9k^ch|K'),tc
6ygIL8xI#LNz3v}T=4W " .####:############: . " lL27FZ0ij)7TQCI)P7u
}RT5-iJbbG5P-DHB<. "# # :################# . " R,YvZ_rnv6ky-G+4U'
$*are@b4U351Q-ug5 "#######################% " 00x8RR%`Om7VDp4M5
PFixrPvl&<p[]1IJ "######:#### %######### " EGgDt8Lm#;bc4zS^
y]0`_PstfUxOC(q "#######:##% .## .### .. " /,}.YOIFj(k&q_V
zcaAi?]^lCVYp!; "##########. #. .:#. . " ;s="v=%04o;ev"%
(;v=(v-($*+[45, "#########% : : : : " ])[n=0].to_i;)%
360)+"al$s=%q#{ "######### :% %#: " ;;"%c"%126+$s<<
126}";d.gsub!(/ "#######% #::#.: %#% " |\s|".*"/,"");;
require"zlib"|| ":######. : :#% " ;d=d.unpack"C*"
d.map{|c|n=(n|| ".######: . :% : " )*90+(c-2)%91};
e=["%x"%n].pack ":###### #: %###%% " &&"H*";e=Zlib::
Inflate.inflate( ".####% :: ########. " &&e).unpack("b*"
)[0];22.times{|y| " %### ########. " ;w=(Math.sqrt(1-(
(y*2.0-21)/22)**(; " .#% ##:%###. " ;2))*23).floor;(w*
2-1).times{|x|u=(e+ " %% . " )[y*z=360,z]*2;u=u[
90*x/w+v+90,90/w];s[( " . " ;y*80)+120-w+x]=(""<<
32<<".:%#")[4*u.count(( " " ;"0"))/u.size]}};;puts\
s+";_ The Qlobe#{" "*18+ ( "##########." ;"Copyright(C).Yusuke End\
oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
v=0055;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP
4ZojjV)O>qIH1/n[|2yE[>:ieC "% :::#####" 97N-A&Kj_K_><wS5rtWk@*a+Y5
yH?b[F^e7C/56j|pmRe+:)B " .:################" O98(Zh)'Iof*nm.,$C5Nyt=
PPu01Avw^<IiQ=5$'D-y? " ######################" g6`YT+qLw9k^ch|K'),tc
6ygIL8xI#LNz3v}T=4W " #. .####:############: " lL27FZ0ij)7TQCI)P7u
}RT5-iJbbG5P-DHB<. " ##### # :################# . " R,YvZ_rnv6ky-G+4U'
$*are@b4U351Q-ug5 " :############################ " 00x8RR%`Om7VDp4M5
PFixrPvl&<p[]1IJ " ############:#### %######### " EGgDt8Lm#;bc4zS^
y]0`_PstfUxOC(q " %############:### %#: %##: : " /,}.YOIFj(k&q_V
zcaAi?]^lCVYp!; " .################. #. .:#. . " ;s="v=%04o;ev"%
(;v=(v-($*+[45, " :##############% : : : : " ])[n=0].to_i;)%
360)+"al$s=%q#{ " ######### :% %#: " ;;"%c"%126+$s<<
126}";d.gsub!(/ " #######% #::#.: %#" |\s|".*"/,"");;
require"zlib"|| " :######. : :" ;d=d.unpack"C*"
d.map{|c|n=(n|| " .######: . :% " )*90+(c-2)%91};
e=["%x"%n].pack " ######%:# .###%" &&"H*";e=Zlib::
Inflate.inflate( " .####% :: ######" &&e).unpack("b*"
)[0];22.times{|y| " .###: :#####" ;w=(Math.sqrt(1-(
(y*2.0-21)/22)**(; " .#% ##:%#" ;2))*23).floor;(w*
2-1).times{|x|u=(e+ " " )[y*z=360,z]*2;u=u[
90*x/w+v+90,90/w];s[( " " ;y*80)+120-w+x]=(""<<
32<<".:%#")[4*u.count(( " " ;"0"))/u.size]}};;puts\
s+";_ The Qlobe#{" "*18+ ( ":##########" ;"Copyright(C).Yusuke End\
oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
v=0000;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP
4ZojjV)O>qIH1/n[|2yE[>:ieC "%.#% :::##" 97N-A&Kj_K_><wS5rtWk@*a+Y5
yH?b[F^e7C/56j|pmRe+:)B "##% ::##########" O98(Zh)'Iof*nm.,$C5Nyt=
PPu01Avw^<IiQ=5$'D-y? "##: ###############" g6`YT+qLw9k^ch|K'),tc
6ygIL8xI#LNz3v}T=4W "# #. .####:#######" lL27FZ0ij)7TQCI)P7u
}RT5-iJbbG5P-DHB<. " ##### # :############" R,YvZ_rnv6ky-G+4U'
$*are@b4U351Q-ug5 " #######################" 00x8RR%`Om7VDp4M5
PFixrPvl&<p[]1IJ " ############:#### %#####" EGgDt8Lm#;bc4zS^
y]0`_PstfUxOC(q " .#############:##% .## ." /,}.YOIFj(k&q_V
zcaAi?]^lCVYp!; " %% .################. #. " ;s="v=%04o;ev"%
(;v=(v-($*+[45, ":####: :##############% : " ])[n=0].to_i;)%
360)+"al$s=%q#{ "%######. ######### " ;;"%c"%126+$s<<
126}";d.gsub!(/ "##########. #######% " |\s|".*"/,"");;
require"zlib"|| "########### :######. " ;d=d.unpack"C*"
d.map{|c|n=(n|| ":#########: .######: . " )*90+(c-2)%91};
e=["%x"%n].pack " :#######% :###### #: " &&"H*";e=Zlib::
Inflate.inflate( " ######% .####% :: " &&e).unpack("b*"
)[0];22.times{|y| " ####% %### " ;w=(Math.sqrt(1-(
(y*2.0-21)/22)**(; " .###: .#% " ;2))*23).floor;(w*
2-1).times{|x|u=(e+ " %## " )[y*z=360,z]*2;u=u[
90*x/w+v+90,90/w];s[( " #. " ;y*80)+120-w+x]=(""<<
32<<".:%#")[4*u.count(( " . " ;"0"))/u.size]}};;puts\
s+";_ The Qlobe#{" "*18+ ( "# :#######" ;"Copyright(C).Yusuke End\
oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
translated from mamememo in Japanese (2010-09-05).
This is awe-inspiring. Thank you.
ReplyDeleteYou are a mad man. You are completely insane.
ReplyDeleteVery, very impressive. Wow.
WOW.
ReplyDeleteDo you accept worshipers?
ReplyDeleteYou rock! Never seen a better quine.
ReplyDeleteWO. AW. WOAW.
ReplyDeleteI get a syntax error in line 1 about the token ')',i don't have much knowledge of ruby,but i want to experience this amazing program,can someone help me?
ReplyDeleteCrane: What version of ruby are you using? I tested it with ruby 1.8.7-p72 and 1.9.2-p0.
ReplyDeleteI tried it with ruby 1.9.1p378
ReplyDeletethe total error message is:
./earthrotate.rb: line 1: syntax error near unexpected token `)'
./earthrotate.rb: line 1: `v=0000;eval$s=%q~d=%!^LcfYoP'
Crane: I was able to get past this by using ruby to execute the script. So use:
ReplyDelete$ ruby earthrotate.rb
instead of:
$ ./earthrotate.rb
@Justin:I tried as what you said:
ReplyDeleteruby earthrotate.rb
and I get this:
earthrotate.rb:12:in `eval': (eval):7: syntax error, unexpected $undefined (SyntaxError)
zcaAi?]^lCVYp!; " %% .###% " |\s|".*"/,"");;
^
(eval):7: syntax error, unexpected ','
zcaAi?]^lCVYp!; " %% .###% " |\s|".*"/,"");;
^
from earthrotate.rb:12:in `main'
1. Copy one of the above programs as a.rb.
ReplyDelete2. Run:
while true; do clear; ruby a.rb | tee b.rb; sleep 1; mv -f b.rb a.rb; done
JAWDROP
This has convinced me to write my first blog comment. That is incredible.
ReplyDeleteWhen I wrote and thought up my first quine I thought that was pretty impressive, however you have completely blown my mind with this one. That is the single most amazing quine that I have ever seen.
ReplyDeleteOh, and for those of you that want to see it in action:
ReplyDelete$ watch -n1 'ruby current.rb | tee next.rb && mv next.rb current.rb'
I've made a YouTube video for those who want to see it in action:
ReplyDeletehttp://www.youtube.com/watch?v=ktq-22iq-Po
Crazy!
ReplyDeleteKeep it up!
Any chance on having a writeup on it's logic?
Please read the source code :-)
ReplyDeletedead Anonymous 2 up: quininess is achieved by having most of the program in a string and evaling it. the only exceptions are the v variable and the eval statement itself. v contains the angle of rotation of the globe at a given moment.
ReplyDeletefully half of the program is a compressed map of the earth, which is unpacked, and as each line is printed, the corresponding line of the globe is rotated according to the value in v and distorted to proper shape by a lot of Math™, converted to ascii by a simple map, and printed in the correct area. A lot of tricks are used to make sure said area does not get executed as code or stored as data. Hope this helps in your own parsing of the source.
qlobe.ruby:24: warning: parenthesize argument(s) for future version
ReplyDeleteruby 1.8.1
although it does work perfectly... just gives a warning.
i've never coded in ruby so i have no idea what the heck that warning means.
that is one AWESOME quine you've built
always had doubts if GOD existed. now i noe He's called Yusuke Endoh.
ReplyDeleteHi, I don't know Ruby at all,but I am very much interested in enjoying this piece or your work :) I tried your code on http://ideone.com/sNY7M but as you could see it's giving compilation error.
ReplyDeleteFor those wondering how to view this:
ReplyDelete1. copy contents of textarea to qlobe.rb
2. for ((;;)); do for i in {1..45}; do clear; ruby qlobe.rb $i; sleep 0.1; done; done
Not sure if the "45" is correct...
It should be 360, not 45. If it's 45 it will only rotate 45° and then start again. So the command should be:
ReplyDeletefor ((;;)); do for i in {1..360}; do clear; ruby qlobe.rb $i; sleep 0.1; done; done
Holy shi..quine.
ReplyDeletefor i in {0..360}; do clear; ruby qlobe.rb $i; sleep 0.05; done
ReplyDelete@Greg, can you script that to run infinitely? I'm not sure how to wrap your script is an infinite do loop.
ReplyDeletegot it.
ReplyDeleteInfinite loop:
being; for i in {0..360}; do clear; ruby qlobe.rb $i; sleep 0.05; done; end while true;
scratch that, doesn't work right, lemme know if any of you figure it out.
ReplyDeletefor (( i=0 ; ; i++ )) do clear; ruby qlobe.rb $i%360; sleep 0.05; done
ReplyDeleteThis is amazing.
ReplyDeleteManaged to avoid flickering using the following:
ReplyDeleteclear; for ((;;)); do for i in {1..360}; do tput cup 0 0; ruby qlobe.rb $i; sleep 0.1; done; done;
Amazing.
ReplyDeleteAwesome...
ReplyDeleteI do not know whether it's just me or if everybody else encountering problems with your site. It looks like some of the written text in your content are running off the screen. Can someone else please provide feedback and let me know if this is happening to them as well? This might be a problem with my internet browser because I've had this happen previously. Many thanks
ReplyDelete