Your SlideShare is downloading. ×
0
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

超絶技巧 Ruby プログラミング - Esoteric, Obfuscated Ruby Programming

4,670

Published on

Ruby allows us to write not only easy-to-read programs but also hard-to-read programs. In this presentation, we introduce our "artistically" hard-to-read programs written in Ruby. We also discuss …

Ruby allows us to write not only easy-to-read programs but also hard-to-read programs. In this presentation, we introduce our "artistically" hard-to-read programs written in Ruby. We also discuss its implementation techniques, if time permits.

Published in: Technology
0 Comments
11 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,670
On Slideshare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
20
Comments
0
Likes
11
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. 超絶技巧 Ruby Programming Esoteric, Obfuscated Ruby Programming 遠藤侑介 Yusuke Endoh
  • 2. Who am I? <ul><li>Yusuke Endoh 遠藤侑介 </li></ul><ul><ul><li>twitter: @mametter </li></ul></ul><ul><ul><li>hatena: http://d.hatena.ne.jp/ku-ma-me/ in Japanese </li></ul></ul><ul><ul><li>blogger: http://mamememo.blogspot.com/ in English </li></ul></ul><ul><li>A committer for Ruby and RubySpec </li></ul><ul><ul><li>1.9.2 assistant release manager </li></ul></ul><ul><li>An esoteric programmer </li></ul>
  • 3. Esoteric Programming <ul><li>普通の人 normal programmer </li></ul><ul><li>Esoteric Programmer </li></ul><ul><li>参考 : ゴルファー cf. code-golfer (14B) </li></ul>alias|send ;$stdin=GC | &quot;%p?&quot;%def# FALSE.gets();(8 | 64).chr+232424. to_s(25)+&quot;, &quot;+%w|w ! | *&quot;orlc&quot;. next<<012|| (c).Yusuke end;&quot;oh, 2009&quot; | &quot;stegano-X.&quot;[0,4].reverse d,be=&quot;whydoes&quot;,&quot;crypto&quot;;:make. | %.mains..tr'eams',be.delete(d) puts “Hello, world!” #!../s/grb -eh http:// d.hatena.ne.jp/kurimura/20090929/1254257912
  • 4. Esoteric Programming Language (esolang) <ul><li>読み書きしにくいように作られた言語 obfuscated, confusing and unreadable programming language </li></ul><ul><ul><li>esoteric: 難解な、深遠な、秘伝的な、奥義に達した </li></ul></ul><ul><ul><li>ex) brainf**k </li></ul></ul><ul><li>共通の特徴 : 奇妙な制約 common feature: bizarre constraint </li></ul><ul><ul><li>使える文字 bizarre kind of character used </li></ul></ul><ul><ul><li>使える命令 bizarre instruction set </li></ul></ul><ul><ul><li>命令順序や文字配置 bizarre execution order and placement </li></ul></ul>+++++++++[>++++++++>++++++++++ +>+++++<<<]>.>++.+++++++..+++. >-.------------.<++++++++.---- ----.+++.------.--------.>+. Hello world in brainf**k
  • 5. Theme: Enjoy esolang with Ruby! <ul><li>制約 を課せば Ruby も esolang として楽しめる Ruby with constraint can be an esolang </li></ul><ul><ul><li>1. 使用文字制約に勝つ ( ○○文字だけで Ruby を書けるか?) beat “character constraints” (Can you write Ruby with __ character-only?) </li></ul></ul><ul><ul><li>2. 文字配置制約に勝つ (アスキーアート Quine ) beat “shape constraints” (ASCII-art Quine) </li></ul></ul><ul><li>見所 Highlights </li></ul><ul><ul><li>むだに深淵な背景理論 esoteric theory </li></ul></ul><ul><ul><li>勝つためなら何でもする dirty hack </li></ul></ul><ul><li>ゲーデル数 Gödel numbering </li></ul><ul><li>コルモゴロフ複雑性 Kolmogorov complexity </li></ul><ul><li>チューリング完全性 Turing completeness </li></ul><ul><li>Ruby の黒魔術 Ruby’s black magic </li></ul><ul><li>コードゴルフ code golf </li></ul><ul><li>文法や意味論の悪用 abuse of syntax/semantics </li></ul>
  • 6. 1. Hello world with __ Character-only
  • 7. Hello world with Number only <ul><li>任意のプログラムが書けます you can write not only “Hello, world!” but also any program </li></ul>require &quot;1234567890&quot; 3168058133690614704472525542553548167675787479850929569348012322294505786632921189012284531906696218369564670777459615871118090530
  • 8. 実装 internal <ul><li>ゲーデル数化 Encoding: Gödel numbering </li></ul><ul><li>Ruby の黒魔術 Ruby’s black magic </li></ul><ul><li>you can install: gem install 1234567890_ </li></ul>Hello world with number only
  • 9. ゲーデル数による符号化 Gödel numbering Hello world with number only
  • 10. 黒魔術 Ruby’s black magic <ul><li>コードに書かれただけの数字の参照を引っぱり出す How to gain number written in code directly </li></ul><ul><ul><li>GC.disable </li></ul></ul><ul><ul><li>at_exit </li></ul></ul><ul><ul><li>ObjectSpace.each_object(Bignum) </li></ul></ul><ul><ul><li>eval </li></ul></ul><ul><li>1.8 と 1.9 両方で動く both 1.8 and 1.9 can run this </li></ul><ul><li>JRuby でも動く(が – X+O オプションが必要) JRuby can also run this, but needs -X+O option; uncool </li></ul>Hello world with number only
  • 11. Hello, world with underscore only require &quot;_&quot; ____ _ _____ ____ __ ____ ____ __ ___ ____ __ __ _ ______ _____ ___ _ _ ___ _____ ______ ____ _ _ ____ _ _ ____ _ ____ __ __ ___ _ ______ ___ ____ __ ______ ____ _ ____ ____ __ _ ____ _ _ ___ _____ _____ _ ______ ____ _ ______ _____
  • 12. 実装 internal <ul><li>プログラムのゲーデル数化 (“ number only” と同じ) also uses Gödel numbering </li></ul><ul><li>ゲーデル数の 6 進数表記をアンダースコアで表す represent each base-6 digit of Gödel number as length of underscores </li></ul><ul><li>Ruby の有名黒魔術 : method_missing Ruby’s famous black magic: method_missing </li></ul><ul><li>you can install: gem install _ </li></ul>Hello world with underscore only
  • 13. なぜ 6 進数? why base-6? Hello world with underscore only
  • 14. Hello world with purely Alphabet only <ul><li>require がない there is no “require” </li></ul>class String def inspect concat begin dup ensure replace String nil concat concat concat concat size concat concat size concat concat size concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat concat concat concat concat size concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat size concat concat concat concat size concat concat concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat size concat concat concat size concat concat size concat concat concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat size concat concat size concat concat concat concat size concat concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat size concat concat concat size concat concat size concat concat size concat concat size concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat size concat concat size concat concat concat size concat concat size concat concat size concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat concat concat concat concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat concat size concat concat size concat concat concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat size concat concat concat size concat concat size concat concat size concat concat size concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat size concat concat concat size concat concat size concat concat concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat size concat concat concat size concat concat size concat concat concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat size concat concat concat concat size concat concat concat size concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat concat concat size concat concat concat concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat concat concat size concat concat size concat concat size concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat concat concat concat concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat size concat concat size concat concat concat concat size concat concat size concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat size concat concat size concat concat concat size concat concat concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat size concat concat size concat concat concat size concat concat concat size concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat size concat concat size concat concat concat concat concat size concat begin size ensure replace String nil end end eval self exit end end copyright MMX Yusuke Endoh p String nil class String def inspect concat begin dup ensure replace String nil concat concat concat concat size concat concat size concat concat size concat size concat begin size ensure replace String nil end end concat begin dup ensure replace String nil concat concat concat concat concat concat size concat size concat begin size ensure replace String nil end end
  • 15. 実装 internal <ul><li>自分で読んでください no time to explain; please read code by yourself </li></ul><ul><ul><li>http:// d.hatena.ne.jp/ku-ma-me/20100709/p1 </li></ul></ul><ul><ul><li>You can read it because it is purely written in Ruby that you know! </li></ul></ul><ul><li>shinh さんのアイデアがベース based on shinh’s idea (Shin’ichiro Hamaji) </li></ul><ul><ul><li>アルファベットと数字だけ Pure Ruby with Alphabet and Number only </li></ul></ul><ul><ul><li>http :// d.hatena.ne.jp/shinichiro_h/20081109#1226217059 </li></ul></ul>Hello world with purely alphabet only
  • 16. 対「文字制約」まとめ summary of anti-character constraints <ul><li>Ruby は使用文字制約に結構強い Ruby beats character constraints </li></ul><ul><li>おまけ : 1.8 と 1.9 は意外に互換である 1.9 is more compatible with 1.8 than you think </li></ul><ul><li>未解決問題 open problem </li></ul><ul><ul><li>小文字アルファベットだけ lower-case alphabet only </li></ul></ul><ul><ul><li>大文字だけ(不可能?) upper-case only (impossible?) </li></ul></ul><ul><ul><li>「記号だけ」は解決済み FYI: “punctuation only” was resolved http://www.kurimura.com/rsencode/ </li></ul></ul>
  • 17. 2. Ruby for Quine in ASCII-art
  • 18. Quine とは What’s Quine? <ul><li>自分自身を出力するプログラム a program that outputs itself </li></ul><ul><li>実装の基本 implementation basis </li></ul><ul><ul><li>手順 1. 自分自身を文字列として再構成する Step 1. construct a string that is itself </li></ul></ul><ul><ul><li>手順 2. その文字列を出力する Step 2. print it </li></ul></ul><ul><li>出力前に整形すると変な Quine ができる we can write “artistic” Quine by shaping it before printing </li></ul>eval s=&quot;puts'eval s='+s.inspect&quot;
  • 19. 山手 Quine Yamanote Quine <ul><li>実行すると隣の駅名になる This program transforms the next station name of Japanese Yamanote Loop Rail line </li></ul><ul><li>29 駅で元に戻る we need invoke ruby 29 times (stations) once </li></ul><ul><ul><li>起動速度重要 invoking speed matters </li></ul></ul><ul><ul><li>JRuby is 10x slower than MRI (3.3sec vs. 33sec) </li></ul></ul>z=27;eval$s=%w!c,s=[&quot;H+{K}8k->dXNpv-cD~@?(zhAi~>JOv<-;A(]oH+MFKs*+KOB825i$%QX9~P=HC{iIlj*Sh# v=3U62LhUXhtnCx^{F=nuTtGG}@85_(xVvIWQ|Vllp[Gt22x&`^K3*ui;IW@O9-(`Z6V_T.E]%WHXYGa{O9A#msMgV{5 R3XS/dxI8zM)XrbFom,$Msj8>=ca#i.yOqM-gtf2xH T#2VYW9Koq.)IjS:&n3f6$Q/@4-8m_[(HxaP>n*b]Ih/3`3T uG-C~3Bn)d.PSdX8 uvtft?;j%bsM^v&h NcaFzv7)uyD=lkc+eYn5&dN/%.|o@pD|BPi+a`rJCgg>?AE; W~){4l9}&quot;,&quot;_m?PM(N5L <',.ht}f8B|*o8|Qg?:v '(@LY'1^KvIm8twKZHvU@:&FS)r[N1?t9k26*=tiLQw<Tq$l ]V1@Z3hnQ:cQ'b)>])-p }r'U[8hN 7`j6SW r-ZW m2 3n<ZaJ %C%g @@+DABEERjKj5Yt~&>xL ~8BN`L#u?tE+CH$wM%*J px[D;A t%se'c waI. R; FIn( VUVq{0 6c Y]'1EV sqNd_V1yp8&quot;].map{| s|n=0;s.unpack(&quot;C*&quot;) .map{| c|n=n* 91+( c-1)%9 2};n}; e= &quot;z=#{z =($*[i=0]?(z+1):z- 1)%29};eval$s=%w&quot;<<3 3<<$s[ 0,903] *3;1 4. time s{|y|b =&quot; &quot;;n=f= proc{|w|b<<e[i,w]; i+=w};t=s;f[4];z.dow nto(0){| a|a<1& &6.t imes {|x| y>1&&y<12&&c[n*60+y* 6-x-67]>0?(b<<32<<32):f[2]}while(0<n=(t/=38)%38)};f[4];y>12& &b[-28,28]=&quot;&qu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ZvoU$eG;kXt[hewZnV!(B(u-[L3)l,6C%3.?u?znQyMgw31s [s4Ne+XNPNcpmuaJ<] Hd:/;va-yp4)mU.&Vr Z@*N3mTZX)0]%^]0d6 a'@njg`2DJ;stf^WTr 3y%gWte5;+Q>ZbENlv rK!4M=y6IQ27&IJm>n w57+;)s=Foy<4pdw5i lSDhJRyao%_Wx+[lx6 D8Goea3uRPpunFulWq 0*3GoGaJyAHF$#bJca 5&Z0K'r[o,K*&quot;/^jv6 m08,PTZy$g?eX[aN4j J]AkXcV72;!};f=0;F .unpack(&quot;C*&quot;).map{ |c|f=f*89+((c-2)%9 0-1)};require'zlib ';t=t.split*&quot;&quot;;$*[0]?(t[/([* -K]+.)([*-K]+.)$/];t=$2+$`+s =$1):(s=t[/.+?[L-z]/];t=$'+s );f=Zlib::Inflate.inflate(Ma rshal.dump(f)[7..-1] );S=%{ t=&quot;# {t}&quot;;eval$s=%w{#$s}* &quot;&quot;;%|}+F*9;P=proc{pu ts(S.s lice!(0, 58));P};P[][][][s. upcase.unpack(&quot;C*&quot; ).map{|c |c-=c>92?4 3:42;;P[][][20.t imes{|n|puts((&quot;% 029b&quot;%(&quot; &quot;+f[60*c+3*n ,3]).unpack(&quot;N &quot;)[0]).gsub( /./){$&<&quot;1&quot;? (S.slice!(0,2) ):(32.chr*2) })}]}][];puts(*[&quot;+&quot;+&quot;-&quot;* 25,&quot;|,##,(c),Yusuke,Endoh,20 09&quot;.split(&quot;,&quot;).join(32.chr)].map{|l|S.slice!(0,32)+l})}*&quot;&quot; ;%|ceY8#<DvO1=x&t9CSOqMYkzHU.kCpz+Vo8hB.1AF&tq21+$/IrMY]U. aDd!-1y!4MMGQm6m?bYh($QMYpXs4g,x1UlbNKH?>NzbisMn?sT@m3,F.A bb`xW!r%'%Ybee>xkUfjf[(*^NdXo_&quot;@+------------------------- hQh%Fx*q[iB7EM&quot;suSG8GVOIzceg/O=4| ## (c) Yusuke Endoh 2009
  • 20. 実装 internal <ul><li>自分自身を再構成する Step 1. construct a string that is itself </li></ul><ul><li>次の駅の形に整形してから出力する Step 2. print it after shaping it as the next station name </li></ul><ul><li>以上をアスキーアートの形で行う Step 3. write the program in ascii art </li></ul><ul><ul><li>フォントデータ(圧縮) font data (compessed) </li></ul></ul><ul><ul><li>駅名(圧縮) station names (compessed) </li></ul></ul><ul><ul><li>圧縮の展開 decompressing </li></ul></ul><ul><ul><li>Quine </li></ul></ul><ul><ul><li>整形 shaping </li></ul></ul><ul><ul><li>ゴミ padding </li></ul></ul>Yamanote Quine z=27;eval$s=%w!c,s=[ &quot;H+{K}8k->dXNpv-cD~@?(zhAi~>JOv<-;A(]oH+MFKs*+KOB825i$%QX9~P=HC{iIlj*Sh# v=3U62LhUXhtnCx^{F=nuTtGG}@85_(xVvIWQ|Vllp[Gt22x&`^K3*ui;IW@O9-(`Z6V_T.E]%WHXYGa{O9A#msMgV{5 R3XS/dxI8zM)XrbFom,$Msj8>=ca#i.yOqM-gtf2xH T#2VYW9Koq.)IjS:&n3f6$Q/@4-8m_[(HxaP>n*b]Ih/3`3T uG-C~3Bn)d.PSdX8 uvtft?;j%bsM^v&h NcaFzv7)uyD=lkc+eYn5&dN/%.|o@pD|BPi+a`rJCgg>?AE; W~){4l9}&quot; , &quot;_m?PM(N5L <',.ht}f8B|*o8|Qg?:v '(@LY'1^KvIm8twKZHvU@:&FS)r[N1?t9k26*=tiLQw<Tq$l ]V1@Z3hnQ:cQ'b)>])-p }r'U[8hN 7`j6SW r-ZW m2 3n<ZaJ %C%g @@+DABEERjKj5Yt~&>xL ~8BN`L#u?tE+CH$wM%*J px[D;A t%se'c waI. R; FIn( VUVq{0 6c Y]'1EV sqNd_V1yp8&quot; ]. map{| s|n=0;s.unpack(&quot;C*&quot;) .map{| c|n=n* 91+( c-1)%9 2};n}; e= &quot;z=#{z =($*[i=0]?(z+1):z- 1)%29};eval$s=%w&quot;<<3 3<<$s[ 0,903] *3; 1 4. time s{|y|b =&quot; &quot;;n=f= proc{|w|b<<e[i,w]; i+=w};t=s;f[4];z.dow nto(0){| a|a<1& &6.t imes {|x| y>1&&y<12&&c[n*60+y* 6-x-67]>0?(b<<32<<32):f[2]}while(0<n=(t/=38)%38)};f[4];y>12& &b[-28,28]=&quot;&quot;<<33 <<&quot;*''#..(c). Yusuke.Endoh.2010&quot;;puts(b)}#c,s=[&quot;H+{K}8k->dXNpv-cD~@? (zhAi~>JOv<-;A(]oH+MFKs*+KOB825i $%QX9~P=HC{iIlj*Sh#v=3U62LhUXhtnCx^{F=nuTtGG}@85_(xVvIWQ|Vllp[Gt22x&`^K3*ui;IW@O9-(`Z6V_T.E] %WHXYGa{O9A#msMgV{5R3XS/dxI8zM)XrbFom,$Msj8>=ca#i.yOqM-gtf2xHT#2 !*''#..(c).Yusuke.Endoh
  • 21. アスキーアートでプログラムを書く How to write “shaped” Ruby program <ul><li>空白とバックスラッシュなしでプログラムを書く write your program with no space and backslash </li></ul><ul><li>と で囲む enclose it </li></ul><ul><li>自由に整形できる you can shape it as you like </li></ul><ul><li>注 : %w() は文字列配列のリテラル NOTE: %w() is a literal for Array </li></ul><ul><li>= </li></ul>Yamanote Quine eval %w( pu ts “ H i” ).join## eval %w(( ).join %w(foo bar) [“foo”, “bar”]
  • 22. 圧縮 compression <ul><li>データサイズとデコーダサイズのトレードオフ trade off between compressed data size and its decoder size </li></ul><ul><li>最適な圧縮方法はデータの規模によって変わる best decoder depends on data size </li></ul><ul><li>コルモゴロフ複雑性とか feel Kolmogorov complexity </li></ul><ul><ul><li>see Wikipedia </li></ul></ul>Yamanote Quine デコーダ小 shorter decoder データ大 longer data データ小 shorter data デコーダ大 longer decoder data size (about) decoder ~ 10 bytes No compression ~ 100 bytes String#to_i(36) ~ 500 bytes Base64 More Zlib + pack
  • 23. 15quzzle <ul><li>Quine でパネル移動後の盤面が出てくる This prints new board that space was moved to specified direction </li></ul>eval$s=%w[b=0 x40e1359a76cb d8f2;i=(m=0.. 15).find{|i|1 >b&m=15<<4*i} ;t=m|n=m<<4*o =(&quot;AdABrBlBAu A&quot;=~/(.)#{ARG V*''}1/||04| |0)-4;(n<1||n >1<<64||[255< <12]&[t>>040| |___________2 |__________15 |___________8 |__________13 |0,t>>16,t]!= [])?t=0:i+=o; ;s=&quot;eval$s=%% w[b=0x%016x&quot;% (b^=t.&b|m&b> >o*4)+$s.gsub (/(|_+d+)+/ ,'')[/;.*/]+&quot; ]*''||0&quot;<<92| |1;z=s=s.scan (/.{13}/);3.t imes{|j|s[(i| |__________11 |__________12 |___________6 |___________7 |0)/4*8+i+j*4 ,0]=m=(z=32.c hr)*13};c=b;4 .times{puts(( 0..3.times{pu ts((s.slice!( 0,4)*z).rstri p)}).map{j=c% 16;c/=16;;(0| |0)<(j)?&quot;|&quot;+j .to_s.rjust(1 2,&quot;_&quot;):m}*(z| |__________10 |___________9 |___________5 |___________3 |0),z)};b==0x fedcba9876543 21&&(&quot;%b&quot;%&quot;1t v7c1th0wylel7 3ba35knw3t&quot;.t o_i(36)).tr(&quot; 01&quot;,&quot;.#&quot;).sca n(/.{25}/){pu ts$&}]*''||0 |___________1 |__________14 |___________4
  • 24. tic-tac-toe (○× ゲーム) <ul><li>(たぶん)世界初、思考ルーチン組み込み対戦型 Quine </li></ul><ul><li>(maybe) the world’s first Quine with embedded AI </li></ul>s=&quot;n=' '[0,2] ###### d|=1<< ## ## $*[0]. ## ## to_i-1 ## ## ;m,i=[ ## ## f=proc ## {|b|a= ## ## [];[73 ## ## ,7,84, ###### 273,56 ## ## ,146,&quot; proc{| t|[t*= &quot;&quot;,s].map{|u|u.gsub!(35.chr,&quot;&quot;)};d=0032205;eval(s+t)}[ %w(448,292].find{|m|b&m==m}?1:9.times{|i|b&(513<<i)<1& &a<<[-f[1<<i|b>>9|b<<9][0],i]}&&a.min||0}][0][d];s='s= &quot;'+s.s plit*' ## ## '+'&quot;pr ## ## oc{|t| ###### ## ## [t*=&quot;&quot; ## ## ,s].ma ## ## ## p{|u|u ## .gsub! ## ## ## ## (35.ch ## ## r,&quot;&quot;)} ## ## ## ## ;d=0%0 ## ## 6o;eva ###### l(s+t) }[%%w( '%d|=512<<i;s<<t+&quot;)]&quot;;27.times{|y|i=y/10;y%=10;puts(y> 6?s.slice!(0,54):(0..4).map{|x|x&1>0?(i+=3;s.slice!(0, 6)):62[y]<1?n*7:n+(y*5-5...y*5).map{|j|1105[j-7]<1&&d[ i]|d[i +9]>0& ###### &~j&59 81[j/2 ## ## ]^d[i] >0?35. ## ## chr*2: n;}*&quot;&quot; ## ## +n}*&quot;&quot; )}||__ ###### (c).Y. Endoh. _2009_ ____)]
  • 25. Quine Reversi <ul><li>思考ルーチン組み込み、勝たないと Quine してくれない </li></ul><ul><li>Quine with embedded AI, it does Quine only when you win </li></ul>1;BEGIN{eval$t=%q(eval(%w(d=&quot;(a,b=b,a;#{c=&quot;(r=l='' ;6 4. ti me s{ |n |p =2 << n+ n/ 8; v= '. .8 6. 41 7. 5.9...32'[((n%8*2-7).*n/8*2-7).abs%19,1];#{o=&quot;m=0; (a |b )& p> 0| |9 .t im es {| s| e, q= 0, p; (e |= q) while(q<<=s*9%26-10)&b>0;a&q>0&&m|=e};&quot;}l>v||m>0&& (l <v && (l ,r =v ,[ ]) ;r << p) }; p= r[ 00 00 00 00 0000])&&(&quot;}#{w=o+&quot;b^=m;a^=m|p)&quot;};a,b=b,a;p)&quot;;z=32. ch r; c+ =&quot; () |' / 'u nt il ($ >< <' ?' +( () |' / '; z) ;g et s)=~/^[A-H][1-8]$/&&(p=1<<$&.tr('A-H','0-7').to_i( 9) ;# {o }' / '; () ;m >0 ); &quot;+ w; b, a= (' / '; () ;2 57 )< <3 2,1025<<31;puts&quot;<<Reversi>>&quot;;loop{i=f=g=0;puts(*(&quot; A&quot; .. &quot;H &quot;) .m ap {| x| 9. ti me s{ x+ =&quot; :&quot; << 32 +a [i+=1]*47+b[i]*56};x}<<[z,*1..8]*z);eval(c+&quot;&&(c,d =d ,c )| |&quot; +d )| |( 72 .t im es {f += a& 1; a/ =2 ;g +=b&1;b/=2};puts&quot;O:#{f},X:#{g}&quot;,f<g&&&quot;youmdon'tmde se rv em qu in e&quot; .t r( &quot;m &quot;, z) || &quot;R ev er si 1; BEGIN{eval$t=%q(#$t)}&quot;;exit)}#(c)Y.Endoh'10)*''))}
  • 26. Merry Quine-mas <ul><li>クリスマスソング演奏機能組み込み Quine </li></ul><ul><li>Quine with wave composer (plays a song before printing itself) </li></ul>open(&quot;/dev/dsp&quot;,&quot;wb&quot;){|h|s=%q{d=[&quot;-KQW[UZbgu*HNT+]TNOOOTZ+cZTUUUUUZbagmssUZbagm ss+wmpgja+KQW[dfnu&quot;,&quot;-KEKOINV[W*HBH+QHBCCCHN+WNHIIIIINVU[aUUINVU[aUU+YOR[^I+KEK OXZbW&quot;,&quot;-W[acg vsc*TZ`+eaaaaa--vucavuca+eadsvs+W[dgvrtc&quot;,&quot;-K991LIL77777dIIIII-- LKKILKKI+Mad[ ^U+K991LHJK&quot;].map{|l|l.unpack(&quot;C*&quot;).map{|c|[(c/6-4)*12/7-8,&quot;012 35b&quot;[c%6,1]. hex]}*4};y=32.chr;l=&quot;@&quot;+[(m=&quot;Jnx4sn3sgd1&quot;)+&quot;vnqkc!6sgd2Lnqc4gz r4bnld;6/Ld s2dzqsg6qd2@bdhud6gdq2Khmf;77/Lds2du4@dqx4gdzqs6oqd2@ozqd4ghl 4qnnl,+Amc 2gdz++2 @udm 4z mc 2gdz 4@+u dm 2zm c2mz+@stqd+r hmf&quot;,m+&quot;E zq sg !6sgd2Sz u4@h nt q4qd hfm r; 6/Ld s2ldm6sgdhq 2rnmfr6d l 2 @o knx ;77/ Wghkd2 ehdkc r4zmc4eknn cr,6qnb jr ,2 gh kkr,4zmc 4okz hm r+Rd 2@odz s+2+,6 qd2@odzs6 +sgd2r ntmc+@ hm f+ inx&quot; ,&quot; Nn4l nqd3k ds1rhm r6zmc2rn 4@qqnvr4fqnv,6/Nnq2sgnqmr6hm2@edrs6sgd2fqntmc;77/Hd2bnldr4 sn4lzjd 6Hhr2ak d4@rrh mfr4eknv+Fzq2zr+2+,6ezq2zr,6+sgd2btqr d+hr+entmc &quot;,&quot;Hd4qtkdr3s gd1 vnqkc6vhsg2sqtsg4zmc4fqzbd,6/Amc2lzjdr6 sgd2mz6@s hnmr2oqnud77/ T gd2fk n4@q hdr4 ne6Hh r2qhfg s4@dntr4 @mdrr,+Amc2v nm+2+6@ cd qr, 2v nm6 +@cdqr2ne+Hh r+knud&quot; ].map{|a| a ,b,c,e, * f =a. sp lit&quot; +&quot;;[a,c =b+c+f *&quot;2&quot;,c ,b+ e+f*&quot;4 &quot;+ &quot;. 8/ /&quot;]*&quot;6/&quot; }.join .tr(&quot; a-z /&quot;,&quot;b- za n&quot;).gs ub (/^/ ,&quot; #&quot;<<32) ;c=0;640.tim es{|w|c<1&&(l=~/(@)?(.*?)(d)/m;($>.<<$1?$2:y+$2).flush;l=$';c =eval$3);c-= 1;a=[128]*z=1200;4.times{|j|t,n=d[j].pop;f=0.3456*2**(t/12.0-j /2);(n>0?(d[ j]<<[t,n-1];z):800).times{|i|t>-3&&a[i]+=16*Math.sin(f.*w*z+i) }};(h.<<a.pack&quot;C*&quot;).flush};puts(s.gsub(/./){&quot;!&quot;>$&?&quot;#&quot;:y}+%( open(&quot;/dev/dsp#{&quot; (c)Y.Endoh2009&quot;;'&quot;,'}&quot;wb&quot;){|h|s=%q{#{s}};eval(s.split*&quot;&quot;)}))};eval(s.split*&quot;&quot;)}
  • 27. qng と qif <ul><li>画像自身を出力する画像 images that draws a program that prints the image itself </li></ul>png gif
  • 28. Quine relay <ul><li># ruby </li></ul><ul><li>l=92.chr;eval s=&quot;s=s.dump[r=1..-2].gsub(/(&quot;+l*4+&quot;){4,}(?!&quot;)/){|t|'&quot;+l*%d+&quot;'%(t.size/2)};5.times{s=s.dump[r]};puts&quot;# pythonprint(amp;quot;# perlnprint(amp;quot;# lua&quot;+l*4+&quot;nprint(&quot;+l*7+&quot;&quot;(* ocaml *)&quot;+l*8+&quot;nprint_endline&quot;+l*15+&quot;&quot;-- haskell&quot;+l*16+&quot;nimport Data.List;import Data.Bits;import Data.Char;main=putStrLn(&quot;+l*31+&quot;&quot;/* C */&quot;+l*32+&quot;n#include<stdio.h>&quot;+l*32+&quot;nint main(void){char*s[501]={&quot;+l*31+&quot;&quot;++intercalate&quot;+l*31+&quot;&quot;,&quot;+l*31+&quot;&quot;(c(tail(init(show(&quot;+l*31+&quot;&quot;/* Java */&quot;+l*32+&quot;npublic class QuineRelay{public static void main(String[]a){String[]s={&quot;+l*31+&quot;&quot;++intercalate&quot;+l*31+&quot;&quot;,&quot;+l*31+&quot;&quot;(c(&quot;+l*31+&quot;&quot;brainfuck&quot;+l*64+&quot;n++++++++[>++++<-]+++++++++>>++++++++++&quot;+l*31+&quot;&quot;++(concat(snd(mapAccumL h 2(&quot;+l*31+&quot;&quot;110&quot;+l*31+&quot;&quot;++g(length )++&quot;+l*31+&quot;&quot;22111211100111112021111102011112120012&quot;+l*31+&quot;&quot;++concatMap(&quot;+l*32+&quot;c->let d=ord c in if d<11then&quot;+l*31+&quot;&quot;21002&quot;+l*31+&quot;&quot;else&quot;+l*31+&quot;&quot;111&quot;+l*31+&quot;&quot;++g++&quot;+l*31+&quot;&quot;22102&quot;+l*31+&quot;&quot;)s++&quot;+l*31+&quot;&quot;21002111010120211222211211101000120211021120221102111000110120211202&quot;+l*31+&quot;&quot;))))))++&quot;+l*31+&quot;&quot;,&quot;+l*63+&quot;&quot;&quot;+l*64+&quot;n&quot;+l*63+&quot;&quot;};int i=0;for(;i<94;i++)System.out.print(s[i]);}}&quot;+l*31+&quot;&quot;)))))++&quot;+l*31+&quot;&quot;,0};int i=0;for(;s[i];i++)printf(&quot;+l*63+&quot;&quot;%s&quot;+l*63+&quot;&quot;,s[i]);puts(&quot;+l*63+&quot;&quot;&quot;+l*63+&quot;&quot;);return 0;}&quot;+l*31+&quot;&quot;);c s=map(&quot;+l*32+&quot;s->&quot;+l*31+&quot;&quot;&quot;+l*63+&quot;&quot;&quot;+l*31+&quot;&quot;++s++&quot;+l*31+&quot;&quot;&quot;+l*63+&quot;&quot;&quot;+l*31+&quot;&quot;)(unfoldr t s);t[]=Nothing;t s=Just(splitAt(if length s>w&&s!!w=='&quot;+l*31+&quot;&quot;'then 501else w)s);w=500;f 0=Nothing;f x=Just((if x`mod`2>0then '0'else '1'),x`div`2);g x= reverse (unfoldr f x);h p c=let d=ord c-48in(d,replicate(abs(p-d))(if d<p then '<'else '>')++&quot;+l*31+&quot;&quot;.&quot;+l*31+&quot;&quot;);s=&quot;+l*31+&quot;&quot;# ruby&quot;+l*32+&quot;n&quot;+l*31+&quot;&quot;++&quot;+l*31+&quot;&quot;l=92.chr;eval s=&quot;+(z=l*31)+&quot;amp;quot;&quot;+s+z+&quot;amp;quot;&quot;+l*31+&quot;&quot;++&quot;+l*31+&quot;&quot;&quot;+l*32+&quot;n&quot;+l*31+&quot;&quot;&quot;+l*15+&quot;&quot;&quot;+l*7+&quot;&quot;)&quot;+l*4+&quot;namp;quot;)amp;quot;)&quot;########### (c) Yusuke Endoh, 2009 ########### &quot; </li></ul>
  • 29. Quine relay <ul><li>このプログラムは、このプログラム自身を出力する Unlambda プログラム、を出力する Whitespace プログラム、を出力する brainfuck プログラム、を出力する Java プログラム、を出力する C プログラム、を出力する Haskell プログラム、を出力する OCaml プログラム、を出力する Lua プログラム、を出力する Perl プログラム、を出力する Python プログラム、を出力する Ruby プログラム、です </li></ul><ul><li>This is a Ruby program that outputs a Python program that outputs a Perl program that outputs a Lua program that outputs a OCaml program that outputs a Haskell program that outputs a C program that outputs a Java program that outputs a brainfuck program that outputs a Whitespace program that outputs a Unlambda program that outputs the program itself. </li></ul>
  • 30. 対「文字配置制約」まとめ summary of anti-shape constraints <ul><li>Ruby は文字配置制約+ Quine に滅法強い Ruby beats shape constraints and Quine </li></ul><ul><ul><li>あやしい言語機能に感謝 thanks to weird language features </li></ul></ul><ul><ul><ul><li>%w, %q </li></ul></ul></ul><ul><ul><ul><li>BEGIN </li></ul></ul></ul><ul><ul><ul><li>eval </li></ul></ul></ul><ul><ul><li>文字列整形も強い also useful methods for string shaping </li></ul></ul><ul><ul><ul><li>String#rjust, split, gsub!, slice!, rstrip </li></ul></ul></ul><ul><ul><ul><li>to_i / to_s / Integer#[] </li></ul></ul></ul><ul><ul><ul><li>unpack / pack / zlib </li></ul></ul></ul>
  • 31. 結論 conclusion <ul><li>Why don’t you enjoy esolang with Ruby? </li></ul><ul><ul><li>むだに深淵な背景理論 esoteric theory </li></ul></ul><ul><ul><li>勝つためなら何でもする dirty hack </li></ul></ul><ul><li>教訓 lessons </li></ul><ul><ul><li>1.8 と 1.9 は意外と互換 1.9 is more compatible with 1.8 than you think </li></ul></ul><ul><ul><li>起動速度重要 invoking speed matters for esoteric programming; JRuby is too slow </li></ul></ul>
  • 32. 最後に aside <ul><li>来年 RubyKaigi 併設で IORCC やりたい I hope IORCC to be held in conjunction with the next RubyKaigi </li></ul><ul><ul><li>International Obfuscated Ruby Code Contest </li></ul></ul><ul><li>__END__ </li></ul>
  • 33. 実行に 5 分かかる Quine Quine that takes five minutes 0;BEGIN{eval((q=%q!;;;;;;;;;;m=0;&quot;t%t{{ix~z~oQec6wJJ:}8:='uaZNui3iT.*zTPZAg|ehncOt_R+PZygXY^pQr(8|ad1=WL P&m|:,~'hhy>c%9]c+c^3q3za?Mav:@;&<uIcrU,(qK6*y/SabA}(ELSn^VDTtX0y,#]-,lX#o3xEM0zNu#,EOH]ztbB]Ej5g:*S1:;6 hJH7G=OoZts_Vg'G/E1[;CF^G$N/lzn.|`LTCh{>{U34gHz~ZbPt,8w?'yJ?Szux+6(V1=kvbQkU&<zs`4*:L)S`|t:Rt_yW16^pY95u b2[W9blchB)023X81n7JhmD?~l#GrjF:}WI^,T13SbN;^X2WOayWs~,)j>=Um.|-{d'l0z<Z[WXD`K,xV{pL{4hJao4z(:P8;<x**2#6 mL4`+[aYYzR[&vx*JEU67hE>;dKzSPC9n]T,Lu>CtxZ{tSuuEKDS}^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DO&go[sr 4=^3gy]DQM3^ Dg8>g _f(~TKy[lX=1 }'?viwdOC4U:fmZ>kaFUkL&s =ciM;pm35Ydzkjtq[$jC9xBU<9@a2_S*J9,g Br'KQYRvcj 1w5Sw #e+v:6>Bv ,gNTR}u_/gi]82]dhVn8z5^1=0 ws2cCXeY.2?z>CHjSiK`A5}:^Pu=3 8 ${-QEtGk<?AQr(zYJOjRYu+@G&h2 i|25q'l8tz$d(bl8Jq=ix%UY{-OCrN{2 b/M'-:85oZLnwJ[iIRC(^Up~QMfMqU] ?iV%zIJ?xGh0x{tGsbpj+&q$q;JTl~t+5D d>oo{^.ni8?a{M&_,v9(HSL@'BKVvCn{W% W^Eb+j`*fwEAX.RQQ4YGGnrER0ue&q-1`1*|,v( n(E_iZ0+]&*bP9_:$C5,U(Ok>q:v'A_iXMBEKn PN_@&_anx>7HUZd&s_obY?GJdr$UHZYoawgVCX_xE4%=*{ o8x6w(MqKD4%?lKn>$E$UzvD]2OH3*^Bx4|Ah9Ti&umkzq %Rf0~f&^F,R=ExlM;$zp1&a45BU)S^;M:F{&pgixwE:~Rf3uV]#efJ](ez%)6Up;wb0jql2vto'WrN0G08]n1)aR6n6z`0XgUc3c13Ct Q[h^k-yB&H3.^2Xy@3j1yxFy7_@0Zp5;?WO<QAFa2?H)WECpEG0ysq$57Yq{g)F.L@H1EPf2M`R<Xls&quot;.unpack(&quot;C*&quot;).map{|c|m=m *91+(c-1)%92};require&quot;tempfile&quot;;c=Tempfile.new(&quot;rk&quot;);c.close(0>0);n=c.path;IO.popen(&quot;gcc#{z=32.chr}-o#{n +z}-xc#{z}-&quot;,&quot;w&quot;){|h|h<<(&quot;#include<stdio.h>&quot;<<10<<&quot;#include<sys/soundcard.h>&quot;<<10<<'int'<<z<<'main(void) {printf(&quot;%lx&quot;,SOUND_PCM_WRITE_RATE);return'<<z<<'0;}')};n=`#{n}`;c.unlink;require&quot;zlib&quot;;a,r,b,c=Marshal. load(Zlib::Inflate.inflate([m.to_s(16)].pack(&quot;H*&quot;).reverse));eval(c)!).split*'')};(c).Yusuke Endoh, 2010

×