TRICK 2018 FINAL
Results
TRICK judges:
mame, eto, shinh, yhara, matz,
leonid, eban
Transcendental
Ruby
Imbroglio
Contest
for RubyKaigi
Transcendental
Ruby
Imbroglio
Contest
for RubyKaigi
What’s “TRICK”
• A contest for “esoteric” Ruby programming
– The most "strange" Ruby program wins
– Ruby version of IOCCC (International Obfuscated C Code Contest)
Transcendental /ˌtransɛnˈdɛnt(ə)l/
“relating to a spiritual realm” *
「霊的領域に関する」
「世俗を超越した」「超絶技巧」
Imbroglio /ɪmˈbrəʊlɪəʊ/
“an extremely confused, complicated, or
embarrassing situation” *
「極めて混乱した、恥ずかしい事態」
* Oxford Dictionaries
The story so far
• TRICK 2013: “Best pangram” by @kinaba
• TRICK 2015: “Best piphilology” by @kinaba
• TRICK 2018 is the 3rd and final(!) contest
!@THEqQUICKbBROWNfFXjJMPSvVLAZYDGgkyz&[%r{¥"}mosx,
4>6]|?'while(putc 3_0-~$.+=9/2^5;)<18*7and:`#
This prints each printable ASCII character exactly once.
This contains each printable ASCII character exactly once.
big , temp = Array 100000000 ** 0x04e2
3 1 4 1 5. 9 2 6
…
This talk
• We held TRICK 2018 FINAL (2018/01/01 – 03/31)
• We announce the winners of TRICK 2018
About TRICK 2018
Judges
Yusuke Endoh (@mametter)
Koichiro Eto (@eto)
Shinichiro Hamaji (@shinh)
Yutaka Hara (@yhara)
Yukihiro Matsumoto (@yukihiro_matz)
Sun Park (@sunleonid)
Hirofumi Watanabe (@eban)
Judges
eto
– Media Artist.
– Chairman at NicoNicoGakkai Beta.
shinh
– The admin of anarchy golf.
– IOCCC winner.
yhara – The author of Japanese esolang book.
matz – The creator of Ruby.
leonid – The 1st super Ruby golfer.
eban – The 2nd super Ruby golfer.
– Full-time Ruby committer at Cookpad.
– The world’s No.1 IOCCC player.mame
Submission statistics
• Thank you for all the submitters!
(I’m using 3D pie charts here to obfuscate the precise number of submissions.)
JP
US
DE
PL BE
Honorable mentions
• Best monkey - Tomoya Ishida (tompng)
• Best abuse of lambda - Shinichiro Hamaji
• Best abuse of meta - Yuki Yugui Sonoda
• Most solvable - Don Yang
• Best layout - Yutaka HARA
• Best abuse of regexp - Benoit Daloze (eregon)
• Most tolerant - Shuichi Tamayose
• Best applause - Colin Fulton
– Enjoy these entries yourself
CAUTION
• From here, this talk has a lot of spoilers!
– Exit now if you want to enjoy analyzing the winners
• The winning entries will be published at:
No k!
http://github.com/tric /trick2018/
Winners & Judges' Prizes
Winner »
eban eto mame shinh yhara leonid matz AVG.
“Most warned”
『最も警告されたで賞』
kinaba
(JP)
13th & yhara award
N/A 5 7 3 7 4 N/A 5.20
kinaba.rb
• A ten-line program
• It prints "TRICK2018"
13th & yhara award
“Most warned”
def STDOUT.write (s); syswrite s
end if def $>.write; end
s = Array.new(){}.map{|s|}
s << (-"Trick").grapheme_clusters{} [0] # frozen_string_literal: Trick
s << ("Ruby".unpack *"ao") [0]
s << "#{10**2018 + 1e2018}" [0]
s << "#{1>2>3 rescue $!.class.trust.class}"[0]
s << "#{true; Kernel.public_class_method}" [0]
s << ($ruby.object_id.coerce +2018) [0]
result = puts s*""
$ ruby kinaba.rb
TRICK2018
kinaba.rb - Spoiler 13th & yhara award
“Most warned”
$ ruby –w kinaba.rb
-:1: warning: parentheses after method name is interpreted as an argument list, not a dec
-:2: warning: mismatched indentations at 'end' with 'def' at 1
-:3: warning: shadowing outer local variable - s
-:4: warning: `frozen_string_literal' is ignored after any tokens
-:5: warning: `*' interpreted as argument prefix
-:6: warning: Float 1e2018 out of range
-:7: warning: comparison '>' after comparison
-:8: warning: unused literal ignored
-:9: warning: ambiguous first argument; put parentheses or a space even after `+' operato
-:10: warning: assigned but unused variable - result
-:1: warning: method redefined; discarding old write
-:2: warning: previous definition of write was here
-:3: warning: given block not used
-:4: warning: passing a block to String#grapheme_clusters is deprecated
-:5: warning: unknown unpack directive 'o' in 'ao'
-:6: warning: Bignum out of Float range
-:7: warning: trust is deprecated and its behavior is same as untaint
-:8: warning: public_class_method with no argument is just ignored
-:9: warning: global variable `$ruby' not initialized
-:10: warning: #<IO:<STDOUT>>.write is outdated interface which accepts just one argument
TRICK2018
Each line has
static (parse/compile-time) warnings
Each line also has
dynamic (run-time) warnings
kinaba.rb - Spoiler
• yhara's comment
• kinaba's comment
13th & yhara award
“Most warned”
Winner »
eban eto mame shinh yhara leonid matz AVG.
“Minimum alternative of irb”
『最小の irb 代替物で賞』
Jan Lelis
(DE)
12th & mametter award
N/A 2 8 6 6 6 N/A 5.60
jan.rb 12th & mametter award
“Minimum alternative of irb”
eval %w?_="";_ _=binding;l
oop( )do $>< <"> >¥s
"if $/> _;p uts "=>
¥s%p "%[ __.e val (_+
=get s||exit!) ,_=""];rescu
e(Ex cep tio n); put
s""+ "¥e [31 m%p ¥e[
0m"% [$! ,_= ""] if/
d¥se |ee /!~ "#$!"end?*""
jan.rb - Spoiler
• Serves as an interactive Ruby interpreter
– Colors an error message
– Supports line continuation
12th & mametter award
“Minimum alternative of irb”
$ ruby jan.rb
>> 1 + 2
=> 3
>> foo
#<NameError: undefined local variable or met
>> "Hello," +
"world"
=> "Hello,world"
jan.rb - Spoiler
• Highlight: How to detect line continuation
– Try to evaluate the input lines
– If it throws an exception, and if its message matches:
– the input is considered "unterminated yet"
• This Regexp determines if the error is either:
12th & mametter award
“Minimum alternative of irb”
/d e|ee/
syntax error, unexpected end-of-input
unterminated string meets end of file
syntax error, unexpected end-of-input
unterminated string meets end of file
jan.rb - Spoiler
• mametter's comment
– I believe this is the ever shortest implementation of
interactive ruby program.
– Both the implementation technique and its appearance
are so smart.
– Thank you for the great program!
• Jan's comment
12th & mametter award
“Minimum alternative of irb”
Winner »
eban eto mame shinh yhara leonid matz AVG.
“Most attractive”
『最も魅力的で賞』
Tomoya Ishida (tompng)
(JP)
11th & eto award
5 10 8 4 9 8 3 6.71
tompng.rb 11th & eto award
“Most attractive”
p,i,u,f,v,q ,h,x=[],
Math,->x{i.sin x},->x,y,z{
x*=1.2; r,a,m=(1 -y=y*1.4+0.15)/2+0.1,y+u[3*x+4*y+5*z*=1.2] /12,x*
x+z*z; l,s,b= m**0.5,i.atan2(z,x),u[6*a]**2/36+((x*x+z*z)**0.5-r)**
2-(1- a* a)/2 /500;l-= (1-y )/8 *d= (u[ 2*s +3*3*t =1-y-
l/2]* u[ 3* s-3*2 * t]) **2/(
1+i. exp( t *10- 9- 5.5 ));e =4*l /( 1+( 0.01+
(1-a=y-d* ( 1 -y) /8)** 2)**0.5 -a)*(1-a * a+((1-
a*a)**2+ 0.01 )** 0.5 )** 0.5 ;(i.atan( (1-0.2*i. asin(
0.98* u[+ +5.0 * i. atan2(y= 3*y-3.4,x *=3)]
))*( (0.01+x*x+ y*y )** 0.5-0.1) +4*(0.01+z *z*4
)**0.5-1)* i.atan( a*a+e*e-1-10/(1+(40*m)**10+((a+1)*10)**10))-0.01)*b},%w& MMM##
TTTQQBKPTVVpQAk5Y7*pgw43v7*pgaor<*"ggau]/~"gau];-~'ga;,,,.'MerryChristmas!&*'',->x ,y,z,
s,m{if(m== 1);g=f [x+=s/2,y+=s/2,z+=s/2];a, b,c=f[x+d=0.01,y,z]-g,f[x,y+d,z]- g,f[x,
y,z+d] -g; p<<[x,y,z,a/d=(a*a+b*b+c *c)**0.5,b/d,c/d];else;(r=0 ...n=[m,4].min).map{|i|r.map{
|j|a, b=[f[ x+k =s*i/n,y+l=s*j/n,z+s],f [x+k,y+l,z],f[ x,y+k,z+l],f[x+l,y,z+k],f[x+s,y+k,z+l],f[x+l,y++s,
z+k]]. minmax;return 8. times { | i|q[x + s * i [0],y+s *i[1] ,z+s*
i[2], s,m/2]}if a*b <0 && s/= 2 }} ; end}, 0,1 .. j=128
(0..7) .each{|i|q[i[ 0] -z= 1.0,i[1 ]-z ,i[2] -z,z,64] ; $><< v[2 *i+64 ,2]};;;
sleep 1;loop{ r,s ,m, l,d, w=i.cos( h+=0.02 ),u[ h],i.cos( m= u[ 2.3 *h ]/5),u [++m],
x.map {[7]*j}, x. map {[7] *j};;p. each{| x,y ,z,a,b, e| x, z=x *r +s*z,z *r-s*
x;y,z =m*y+ l*z ,m *z -l*y;x, y=64* (x+ 1 ),64 *( 1- y ) ;x<j &&y<
j&&z< d[x ][ y]&& (d[x][y] ,w [x][ y]=z ,( 8* (1 +( a*r+b+
e*s)/2) /2).floor)};32.times{|i|4.times{|x|w[((u[i**3]+u[h/4+i]/4)*j+x[0])%j][(h/2+u[i*i])%1*j+x[1]]=5}};f=[1,1]
$><<27.chr+ ?[+f* ';'+?H+(0..63) .map{|y|x.map{|x| v[w[x-=1 ][2*y]*8+w[x][2*y+ 1]]}.join}*$/}
tompng.rb - Spoiler 11th & eto award
“Most attractive”
tompng.rb - Spoiler 11th & eto award
“Most attractive”
• 3D rendering of X'mas tree in terminal
• eto's comment
• tompng's comment
Winner »
eban eto mame shinh yhara leonid matz AVG.
“Best double meaning”
『最高のダブルミーニングで賞』
Tomoya Ishida (tompng)
(JP)
10th & matz award
5 3 10 7 7 8 8 6.86
tompng2.rb 10th & matz award
“Best double meaning”
• Works as a FizzBuzz-like program
$ ruby tompng2.rb
1
2
Ruby
4
Trick
Ruby
7
8
Ruby
Trick…
tompng2.rb 10th & matz award
“Best double meaning”
• Looks like a FizzBuzz program
…
def fizzbuzz n
set_error 'wrong argument type' if n.nil?
if n < ​0
n = -n​
retval =​fizzbuzz n
return ​​​​​retval
else
…
tompng2.rb - Spoiler 10th & matz award
“Best double meaning”
• Contains many Unicode spaces
…
def ■ fizzbuzz■n
set_error 'wrong argument type' if n.nil?
if n < ◆0
n = -n​◆
retval =​◆ fizzbuzz■n
return ​​◆◆◆◆◆ retval
else
…
■:U+00A0 No-break Space
◆:U+200B Zero Width Space
tompng2.rb - Spoiler 10th & matz award
“Best double meaning”
• Looks like a fizzbuzz, and is actually a fizzbuzz
• However, the interpretation is completely different
than we expect
– For example, is not an integer negation,
but calls String#-@ (freeze)
• Of course, if all Unicode spaces are removed,
it also works correctly as we expect!
n = -n
tompng2.rb - Spoiler 10th & matz award
“Best double meaning”
• matz's comment
– Rubyは見栄えに気を使う言語です。コードがどのように見
えるか、やりたいことが簡潔に表現できていて、余計なもの
を書かずに済むように言語デザイン的に工夫されていま
す。しかし、本作品はスペースを有効(?)活用することで、
見栄えと動作を分離することに成功しています。Rubyのパ
ワーのひとつの源である「濫用可能な文法」の極致を堪能し
てください。
• tompng's comment
Winner »
eban eto mame shinh yhara leonid matz AVG.
“Most (un)readable”
『最も読みやすい(読みにくい)で賞』
Yutaka HARA
(JP)
9th
7 10 7 7 N/A 6 5 7.00
yhara.rb 9th
“Most (un)readable”
• A Quine that explains how to work in Japanese
def method_missing(n);$*<<n.to_s.bytesize
n[-1]=="!" and eval$*.map(&:chr).join;end
*自己言及的なプログラム.
これは「自己に言及」したQuineプログラムです.
動かすには普通に無引数で実行してください.
MRIの最新の安定版で動作確認を行っています.
*冒頭の2行が日本語プログラミングのDSLを提供します.
Rubyはピリオドまでの部分がメソッド名であると解釈します.
そのままではNoMethodErrorになります.
それをmethod_missingを使って検知しメソッド名のbytesizeをASCIIコードとして文字にします.
メソッド名が半角の!で終わる場合、記憶した文字たちをjoinしてevalします.
これにより任意のRubyプログラムを日本語により記述することができます.
このプログラムの場合はこのファイルをreadし出力するようになっています.
*Note:文の長さは注意が必要.
UTF_8の日本語は1文字が3bytes.
端数が丁度になるよう英語を入れる.
以上、自己言及的programでした!
yhara.rb - Spoiler 9th
“Most (un)readable”
*自己言及的なプログラム.
これは「自己に言及」したQuineプログラムです.
動かすには普通に無引数で実行してください.
MRIの最新の安定版で動作確認を行っています.
byte length
36
62
60
60
$
>
<
<
ASCII code
method calls
(hooked by method_missing)
eval'ed code
$><<IO.read($0)
yhara.rb 9th
“Most (un)readable”
• yhara's comment
Winner »
eban eto mame shinh yhara leonid matz AVG.
“Best compiler”
『最高のコンパイラで賞』
Tomoya Ishida (tompng)
(JP)
8th
7 2 9 9 8 9 7 7.29
tompng3.rb 8th
“Best compiler”
(B||=[])<<6;C||=[];C<<%w@0 if@;
a=?;*2018;C<<%w@2 (e=ARGV[0]);e=File.read@;
t=->(i,s){s&&a[i.to_i,s.size]=s};C<<%w@25 (e)if@;
u=->{C.map{|i,s|t[i,s]};eval(a)};C<<%w@30 (/^¥.+$@;
at_exit{_,u=u,->{};_[]};C<<%w@37 /!~e&&File.exist?(@;
C<<%w@55 e));d='[><+-,.]';i=32.chr;f=0..79;c=(0..7).m@;
C<<%w@99 ap{|c|b=['C||=[];','a=?;*2018;','t=->(i,s){s@;
C<<%w@143 &&a[i.to_i,s.size]=s};','u=->{C.map{|i,s|t[i,@;
C<<%w@188 s]};eval(a)};','at_exit{_,u=u,->{};_[]};'];o=@;
C<<%w@233 0;f.map{|f|j=(0..67).map{|r|r-=34;s=f-34;m,n=@;
C<<%w@278 r.abs,s.abs;h=->x{m<25&&n<34&&(x<0||n>17)};q=@;
C<<%w@323 ->x{n<x+34&&x<n&&n<34};[h[r],q[-r],q[r],n<11|@;
C<<%w@368 |(m<17&&n<34),n<12,r**4*1.6+16*(s-25)**4<8*17@;
C<<%w@413 **4||(s>37&&s>17-r&&4*s<173-r),r**4+16*(s-25)@;
C<<%w@458 **4<8*17**4,h[-r]][c]};r,p=j.index(!!0),j.cou@;
C<<%w@503 nt(!!0);next(i*68)if(!r);k=f==45?'(B||=[])<<'@;
C<<%w@548 +c.to_s+?;:'';g=b[0];(k+=b.shift)if(g&&g.size@;
C<<%w@593 <=p-k.size);l=p-k.size-o.to_s.size-9;s=64.chr@;
C<<%w@638 ;if(l>0);k+=['C<<%w',s,o,i,a[o,l],s,?;]*'';o+@;
C<<%w@683 =l;end;(i*r)+k+?;*([p-k.size,0].max)+i*(68-r-@;
C<<%w@728 p)}};(e.chars-(e.chars-d.chars)).each_slice(8@;
C<<%w@773 ){|l|puts(f.map{|y|l.map{|r|c[d.index(r)][y]}@;
C<<%w@818 .*(i*17).rstrip});4.times{puts};};else;x,i=@;
C<<%w@861 Hash.new{0},0;y=%(while(x[i]!=0);i+=1;i-=1;@;
C<<%w@904 x[i]+=1;x[i]-=1;x[i]=($<.binmode.getc||0)@;
C<<%w@945 .ord;$><<(x[i]&0xff).chr;end).split(?;)@;
C<<%w@984 ;eval(B.map{|a|y[a]}*?;);end;;;;;;;;;@;
C<<%w@1021 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;@;
C<<%w@1051 ;;;;;;;;;;;;;;;;;;@;
tompng3.rb - Spoiler 8th
“Best compiler”
tompng3.rb - Spoiler 8th
“Best compiler”
• Brainf*ck to Ruby compiler
✓ The Ruby code works as the original Brainf*ck code
✓ The Ruby code shapes like the original Brainf*ck code
✓ The Ruby code works as the compiler if a file is given
✓ (Hard-coded font data is cute)
++++[->+
+++[->++
+++++>++
+<<]<]>>
compile
Brainf*ck code Ruby code
tompng3.rb - Spoiler 8th
“Best compiler”
• tompng's comment
Winner »
eban eto mame shinh yhara leonid matz AVG.
“Most composable”
『最も組合せ可能で賞』
Colin Fulton
(US)
7th & shinh award & leonid award
5 4 9 10 9 10 4 7.29
justcolin.rb 7th & shinh award & leonid award
“Most composable”
$l||=__LINE__;eval q=%q[k =";eval q=%q";
######## (c) 2018 (MIT License) ########
;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17
$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");
;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;
;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z
(y=->{z=puts(z.map &:rstrip)})&&(s="")&&
e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;
;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)}
(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&
c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||
g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};
;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr}
b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;
(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&
w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};
;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]}
;at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
justcolin.rb - Spoiler 7th & shinh award & leonid award
“Most composable”
$l||=__LINE__;eval q=%q[k =";eval q=%q";$l||=__LINE__;eval q=%q[k =";eval q=%q";
######## (c) 2018 (MIT License) ################ (c) 2018 (MIT License) ########
;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17
$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");
;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;
;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z
(y=->{z=puts(z.map &:rstrip)})&&(s="")&&(y=->{z=puts(z.map &:rstrip)})&&(s="")&&
e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;
;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)};h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)}
(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&
c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||
g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};
;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr};x=->{"$l||=__LINE__"+k+91.chr+q+93.chr}
b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;
(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&
w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};
;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]};$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]}
;at_exit{b=b&&($z||81.times(&u)&&$z=1)}];at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
$l||=__LINE__;eval q=%q[k =";eval q=%q"; $l||=__LINE__;eval q=%q[k =";eval q=%q";
######## (c) 2018 (MIT License) ######## ######## (c) 2018 (MIT License) ########
;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17
$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");
;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;
;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z
(y=->{z=puts(z.map &:rstrip)})&&(s="")&& (y=->{z=puts(z.map &:rstrip)})&&(s="")&&
e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;
;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)}
(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&
c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||
g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};
;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr}
b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;
(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&
w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};
;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]}
;at_exit{b=b&&($z||81.times(&u)&&$z=1)}] ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
$l||=__LINE__;eval q=%q[k =";eval q=%q";
######## (c) 2018 (MIT License) ########
;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17
$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");
;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;
;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z
(y=->{z=puts(z.map &:rstrip)})&&(s="")&&
e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;
;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)}
(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&
c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||
g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};
;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr}
b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;
(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&
w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};
;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]}
;at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
justcolin.rb - Spoiler 7th & shinh award & leonid award
“Most composable”
$l||=__LINE__;eval q=%q[k =";eval q=%q";$l||=__LINE__;eval q=%q[k =";eval q=%q";
######## (c) 2018 (MIT License) ################ (c) 2018 (MIT License) ########
;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17
$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");
;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;
;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z
(y=->{z=puts(z.map &:rstrip)})&&(s="")&&(y=->{z=puts(z.map &:rstrip)})&&(s="")&&
e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;
;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)};h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)}
(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&
c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||
g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};
;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr};x=->{"$l||=__LINE__"+k+91.chr+q+93.chr}
b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;
(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&
w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};
;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]};$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]}
;at_exit{b=b&&($z||81.times(&u)&&$z=1)}];at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
$l||=__LINE__;eval q=%q[k =";eval q=%q";$l||=__LINE__;eval q=%q[k =";eval q=%q";
######## (c) 2018 (MIT License) ################ (c) 2018 (MIT License) ########
;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17
$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");
;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;
;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z
(y=->{z=puts(z.map &:rstrip)})&&(s="")&&(y=->{z=puts(z.map &:rstrip)})&&(s="")&&
e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;
;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)};h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)}
(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&
c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||
g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};
;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr};x=->{"$l||=__LINE__"+k+91.chr+q+93.chr}
b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;
(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&
w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};
;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]};$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]}
;at_exit{b=b&&($z||81.times(&u)&&$z=1)}];at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
$l||=__LINE__;eval q=%q[k =";eval q=%q";
######## (c) 2018 (MIT License) ########
;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17
$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");
;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;
;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z
(y=->{z=puts(z.map &:rstrip)})&&(s="")&&
e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;
;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)}
(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&
c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||
g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};
;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr}
b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;
(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&
w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};
;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]}
;at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
justcolin.rb - Spoiler 7th & shinh award & leonid award
“Most composable”
$l||=__LINE__;eval q=%q[k =";eval q=%q";$l||=__LINE__;eval q=%q[k =";eval q=%q";$l||=__LINE__;eval q=%q[k =";eval q=%q";
######## (c) 2018 (MIT License) ################ (c) 2018 (MIT License) ################ (c) 2018 (MIT License) ########
;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17
$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");
;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;
;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z
(y=->{z=puts(z.map &:rstrip)})&&(s="")&&(y=->{z=puts(z.map &:rstrip)})&&(s="")&&(y=->{z=puts(z.map &:rstrip)})&&(s="")&&
e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;
;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)};h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)};h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)}
(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&
c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||
g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};
;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr};x=->{"$l||=__LINE__"+k+91.chr+q+93.chr};x=->{"$l||=__LINE__"+k+91.chr+q+93.chr}
b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;
(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&
w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};
;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]};$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]};$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]}
;at_exit{b=b&&($z||81.times(&u)&&$z=1)}];at_exit{b=b&&($z||81.times(&u)&&$z=1)}];at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
$l||=__LINE__;eval q=%q[k =";eval q=%q";
######## (c) 2018 (MIT License) ########
;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17
$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");
;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;
;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z
(y=->{z=puts(z.map &:rstrip)})&&(s="")&&
e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;
;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)}
(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&
c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||
g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};
;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr}
b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;
(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&
w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};
;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]}
;at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
$l||=__LINE__;eval q=%q[k =";eval q=%q";
######## (c) 2018 (MIT License) ########
;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17
$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");
;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;
;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z
(y=->{z=puts(z.map &:rstrip)})&&(s="")&&
e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;
;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)}
(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&
c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||
g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};
;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr}
b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;
(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&
w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};
;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]}
;at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
justcolin.rb - Spoiler 7th & shinh award & leonid award
“Most composable”
$l||=__LINE__;eval q=%q[k =";eval q=%q";
######## (c) 2018 (MIT License) ########
;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17
$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");
;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;
;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z
(y=->{z=puts(z.map &:rstrip)})&&(s="")&&
e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;
;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)}
(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&
c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||
g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};
;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr}
b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;
(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&
w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};
;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]}
;at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
$l||=__LINE__;eval q=%q[k =";eval q=%q";$l||=__LINE__;eval q=%q[k =";eval q=%q";
######## (c) 2018 (MIT License) ################ (c) 2018 (MIT License) ########
;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17
$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");
;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;
;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z
(y=->{z=puts(z.map &:rstrip)})&&(s="")&&(y=->{z=puts(z.map &:rstrip)})&&(s="")&&
e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;
;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)};h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)}
(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&
c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||
g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};
;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr};x=->{"$l||=__LINE__"+k+91.chr+q+93.chr}
b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;
(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&
w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};
;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]};$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]}
;at_exit{b=b&&($z||81.times(&u)&&$z=1)}];at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
$l||=__LINE__;eval q=%q[k =";eval q=%q"; $l||=__LINE__;eval q=%q[k =";eval q=%q";
######## (c) 2018 (MIT License) ######## ######## (c) 2018 (MIT License) ########
;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17
$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");
;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;
;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z
(y=->{z=puts(z.map &:rstrip)})&&(s="")&& (y=->{z=puts(z.map &:rstrip)})&&(s="")&&
e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;
;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)}
(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&
c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||
g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};
;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr}
b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;
(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&
w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};
;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]}
;at_exit{b=b&&($z||81.times(&u)&&$z=1)}] ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
justcolin.rb - Spoiler 7th & shinh award & leonid award
“Most composable”
• Works as a cell of "the Game of Life"
– You can copy and paste it as a cell
– The composed program print the next generation
• Highlight: How to detect which cell is filled or not
– Y-coordinate:
– X-coordinate:
• Another highlight: Very fragmented code
– To make it vertically composable, no block ranges multi-
line
__LINE__
;;……s=%; (spaces) ;;……s=%;
justcolin.rb - Spoiler 7th & shinh award & leonid award
“Most composable”
• leonid's comment
– Box-shaped code that can stack: Fascinating.
– It's also a quine: Incredible.
– It's a dot in the Game of Life: AMAZING!
• shinh's comment
• justcolin's comment
Winner »
eban eto mame shinh yhara leonid matz AVG.
“Most reversible”
『最もリバーシブルで賞』
Yusuke Endoh
(JP)
6th & eban award
9 7 N/A 9 8 8 4 7.33
mame.rb 6th & eban award
“Most reversible”
• A sorting program
a,b=:reverse,:itself;b=b
a=b=:itself;b
r||=->s,m=a{s.send(m)};a
puts r[$<.sort_by(&r),b]
;r||=->s,m=a{s.send(m)};
a=b=:reverse;0
b,a=:reverse,:itself#
$ cat input.txt
3
2
1
$ ruby mame.rb input.txt
1
2
3
mame.rb - Spoiler 6th & eban award
“Most reversible”
– yields a reverse-sort program
– yields a program that sorts by reversed lines
– yields a program that reverse-sorts by reversed lines
– yields the original sorting program
ruby mame.rb mame.rb > rsort.rb
ruby rsort.rb rsort.rb > sortr.rb
ruby sortr.rb sortr.rb > rsortr.rb
ruby rsortr.rb rsortr.rb > mame2.rb
mame.rb - Spoiler 6th & eban award
“Most reversible”
• eban's comment
• mame's comment
Top five awards
Winner »
eban eto mame shinh yhara leonid matz AVG.
“Most three-dimentional”
『最も立体的で賞』
Tomoya Ishida (tompng)
(JP)
8 8 8 6 9 8 6 7.57
“Most three-dimentional”
tompng4.rb
X=[];def self.method_missing n;n.to_s.chars;end
l=[];def l.-a;X<<a=[nil,*a];a;end;def l.+a;self-a;end
class Array;def-@;[]-self;end;def-a;replace [*self,nil,*a
]end;alias +@ -@;alias + -;end;def gen3d f;yield;b=['solid obj'];w,
h=X[0].size,X.size;X<<[];a=->r,z,dr,dz{;r-=w/2.0;z*=2;r2,z2=r+dr,z+dz*2;if r>0||r2>
0;r=[0,r].max;r2=[0,r2].max;16.times{|i|m=Math;p=m::PI/8;;c,s=m.cos(t=i*p),m.sin(t)
c2,s2=m.cos(t=(i+1)*p),m.sin(t);t-=p/2;[[0,1,2],[0,2,3]].map{|a|b.push [:facet,'n'+
+ 'ormal',dz*m.cos(t),dz*m.sin(t),-dr]*' ','outer loop',a.map{|i|'v'+
++ "ertex #{[[r*c,r*s,z],[r*c2,r*s2,z],[r2*c2,r2*s2,z2],[r2*
+c, r2*s,z2]][i]*' '}"},:endloop,:endfacet}}end};(0...h).
map{| y|w.times{|x|[X[y-1][x]||a[x,y,1,0],X[y+1][x]||
a[x+1,y+
1,-1,0],X[
y][x-+1]||a[
x,y+1,0,-1],X[y
][x++1]||a[x+1,y,
0,1]]if X[y][x]}}
s=[b,'end'+b[0]]*
$/;File.write(f,
s);X.replace(
[]);end
gen3d 'wine_glass.stl' do
l--ww------------------ww--l
l--ww------------------ww--l
l--ww++++++++++++++++++ww--l
l--ww++++++++++++++++++ww--l
l--ww++++++++++++++++++ww--l
l--ww++++++++++++++++++ww--l
l---ww++++++++++++++++ww---l
l----www++++++++++++www----l
l------www++++++++www------l
l--------wwwwwwwwww--------l
l-----------wwww-----------l
l------------ww------------l
l------------ww------------l
l------------ww------------l
l-----------wwww-----------l
l---------wwwwwwww---------l
l----wwwwwwwwwwwwwwwwww----l
end
• Generates 3D model data of
"solid of revolution"
• The shape is configurable by
the DSL
“Most three-dimentional”
tompng4.rb - Spoiler
$ ruby tompng4.rb > wine_glass.stl
gen3d 'ochoko.stl' do
l------------------------l
l-ww------------------ww-l
l-ww------------------ww-l
l-ww++++++++++++++++++ww-l
l-ww++++++++++++++++++ww-l
l--ww++++++++++++++++ww--l
l---wwww++++++++++wwww---l
l----wwwwwwwwwwwwwwww----l
l----www----------www----l
end
• Tompng's comment
“Most three-dimentional”
tompng4.rb
Winner »
eban eto mame shinh yhara leonid matz AVG.
“Best one-liner”
『最高のワンライナーで賞』
Colin Fulton
(US)
6 9 8 6 7 7 10 7.57
“Best one-liner”
justcolin2.rb
• One-liner
$🚀=0;def 🤔 🏷,🤔=0,&b;puts ' '*$🚀+(
🤔 ?"":"🚫 ")+🏷;$🚀+=4;b&.[];$🚀-=4;end
“Best one-liner”
justcolin2.rb - Spoiler
• 68-character
test framework
require './justcolin2'
🤔 "Math" do
🤔 "Addition" do
🤔 "One plus one equals two.",
1+1 == 2
🤔 "One plus one equals eleven.",
1+1 == 11
end
end
$ ruby test.rb
Math
Addition
One plus one equals two.
🚫 One plus one equals eleven.
“Best one-liner”
justcolin2.rb
• justcolin's comment
Top three awards
Winner »
eban eto mame shinh yhara leonid matz AVG.
“Best png viewer”
『最高の png のビューアで賞』
Tomoya Ishida
(Japan)
8 8 8 7 8 6 9 7.71
“Best tool to view png”
tompng5.rb
X=[];class String def-@;replace ?-+self end;def-a;X.reject!{|x|x.
__id__==__id__};a.replace(self+?-+a) end end;at_exit{eval C=(Zlib
.inflate Integer((X*?-).tr(?-,'').tr('q-z','0-9'),26).digits(256)
.pack'C*')};def method_missing n;(X<<n.to_s)[-1]end;require'zlib'
fzygtoxyzgntmdmuwvfoffbpmvzojpkhczvjvjdbtscnldwbdoprackddovivvmkz
ponzmosvtjciwkgaslscxxxwudeesmmqpfhislxuxnnypulxstzgobyaekqqhbjcg
mvko------------ddkeys----eivhnccaqyiw---bzyccmt-----------ymtnge
jwhi--------------pjxf------mdarbtumnv---qasda--------------gmwdt
wrtk---qtpzgnce----fsl-------fkgzgtbpp---gwnm----pxkpqkdiw---owga
momz---yjjvpnvar---zeo---v-----duvalwu---nsqt---waofemwakivnyqkjd
fzag---uhvusmkl----kzb---rhc----iutzjr---mqlh---ayijpwativpweaato
xexs--------------rvgv---pjdz-----lkkg---uiaw---lovitupw-----fwmn
kfru------------jvjpgv---jskycf----pal---gbuf---hfdnywog-----iuca
pntn---apmkqroeuzwuwkw---gqnmgof-----b---hlpl---vkkyhfyrqfr--jwrl
kmdb---dhspujhmtgrkccu---uonfummdt-------rqfw----bpiactehwp--fncq
yzvz---gdaxebplhfndran---ytfmviryeh------hqwkl---------------nced
bibu---fnkdthgldhkxxjg---rwnmpudhbqin----gucoyki------------hfura
cqdgqpyzqfzknvdjoxxhpjulwwyebtocxdrvklbuviwwcatlmdosxfvwntzbijguy
iglrvvzlxerflupxvsyujfacuwhrvmnecgtewtqkhtdggcltejiyqcluclkycwvzg
vvxfysvttfbeglvrlngntdngzyhqrmltazwdydxrsvjploembhgxdvfmmhepbschm
brn--iqrcdb--evv----tqp------lg--uein-wzut--mr------wkh------foqz
zsf--srjnjp--ampb--pfio--hgtekx--rrr---fwd--jn--xqkezcz--vsb--nya
khrc--evlr--oioxs--mqce--bqfmag--bwz---xda--qw--jnuzelr--qzi--itx
mdxd--duso--wxbot--nmon--ugnbdpc--a--c--e--hlg--twxndre--tby--rhg
evhbn--zb--dtxmiz--dpia------vie--h--i--t--shh------kfn------owna
ealmt--kb--scxdjy--smvl--dqmgebk--t--s--t--gfd--updcbnc--rh--dwwp
dvpnxb----wpljjdy--kolc--qflyleok---xkv---usbj--jhrawbn--ewx--bgf
eaqwrw----ejwxhet--dice--eoczconm---urz---rqyp--hovvvfc--bskj--el
aocjcts--jtumwxm----mgy------xpaoq-jtwqr-aipay------dhy--iync--hk
sckddmvuvvuhhqstumaykvczaaujrumqbbqsdvdycplyrlkkojlxnkrhbbrmnjxyf
cdtcmpfmjvthwkpzucbblttgumomlxnxwjeypfeagaukfzeokzxjebkpigcvlqnso
“Best tool to view png”
tompng5.rb - Spoiler
$ ruby tompng5.rb trick.pngtrick.png undef p;X=[];class String def-@;replace ?-+dup end;def-a;X.reject!{|x|x.__id__==__id__};a.replace(self+?-+a) end end;at_exit{eval C=
(Zlib.inflate (X*?-).tr(?-,'').tr('q-z','0-9').to_i(26).digits(256).pack'C*')};def method_missing n;(X<<n.to_s)[-1]end;require'zlib'
pghvsnjhoofjrwvjtxqlw---y----b-udb-----------------------------------------------------ufb---m-f--r-------c--e--biazgocgwnpszndfbbck
dyxtcctagqcilhsebalmf--ypf--------r------------------------------------------------------------b----d--uz-l-----ffbozfbtuigyudtfkdnx
jmhluglcuaehejkvovjff------tebo-----s-------------------------------------------------------v----j-----m--b--d--ebwsqqvgxrttypflckmz
oblorqnmdvruvqzfqhrmn-o-----uy----------------------------------------------------------qa--gy-c--j-s--q-c------dqonloqramgtortmnsjq
samuaumugzrletlxbvkta----g-------------------------------------------------------------c---d---q-------v---o--e-opitgsxgmsugemdwvqgq
ckbscuieodvpwnhbauivj--e-i--n--------i---------------------------------------------------c--vl---bb-------m-----cukwrqlloyflvlzxpibt
hjdvffjawdvllwkcldzovr---r----b------------------------------------------------------------x---------------v--ycixmkbvtyqqxcswmkgrdw
qyspivrsabfdvblsarety----q---v---f---------------------epamr-----------------judw----------t------o---ew-d---y--vzmoicxsfehfxntzzqyg
sjukcaolowandodldotxi-------------sygy-----------------tctxp-----------------ibko--------------i------l----a----mdlkytizjgpkjspwrqtu
vogerfbowkuwsqhdeibuf------e------uopq---------------------------------------aoqo-------------q-----r-h-------r-zqiorecrmcbpgjpProtu
uqrgwyktyxxkvplkdbrhu----------whwwuxuumjo--nepthgoehr-aiqco----teqniNhec----cufq-----lpamf----------g------t--uvhxtsqkjuijlwcaywkbu
upwlhderikimkrrmurzpi----------dvvxgodrhgq--xwqsytawos-owmmh---hsfidyuilqks--lzhq--giguob------------vw--v------srnhdhaaravmghesnchk
nhxdggbfbbbsrxxbfrkjx-------------hdik------sggp--------cpsr-odmhd-----mis---hwpP-nxhhl-------------------------dwxivygzsnzfgmtfhunv
qdamzlzqmlwklhyaunljs-------------wzyl------rcm---------xtiv-diiq------------clxiwckjw--------------------------aymchwbafjfrewtzczsk
pspxubmobxbjkweonloyv-------------cfpu------sky---------mzsy-yuwc------------xmiNdhdtnx-------------------------uovolimftfvbcniFupwc
trjtxlusthfmjxbpqnxcf-------------yhvm------dcn--------yteox--lkiN-----mtnn--jqqt---ionfx-----------------------ekdhyvellwsejrvoshqf
gdjhdnrfglhwdrxdndwpy-------------oopcxmal--uwv---ug---zimyh---mitmzrmzlnb---yvuj-----sdem----------------------sbnvasaeqbnrnmgdogrs
yyrdjtprmuriigavmhttl---------------smhyi---r-kh--------oxuu------eokxaj------nr------o-yz-u---yr-k---x---------xxjeexllcydmfdjsnyut
beuthqkuywpofkatgtnsb------------------------------qd-------------------------------------------k-g-vzax--------tcvzgfgvsgffbhjiddvw
ztjzsdtjyaudcildemqhl----------------------------r---k-----t-------------------------------g-ar--c-----q---gl---bjbiNtuklzovxiiotoru
hfkngdjrdtbuxvosvtijm---------------------------------------------------------------------m-w-oab-g-g-x---gh----bnrpayvlgyjenqfylivv
empxoqhntdadikipPorxi--------------------------------v-------a----------------------------sp-g-ah-g--lzmky--y---yabryajvphvicgijypbq
hymaztowwfoowfxzsiyis------------------------f-i-m-m----n----------------------------------i--j-dvvpy-q-jt--r---jiadkbjiuskwjlesyivk
hqmffygttrxjgazatomhp-----------------------------g---g-a--af-------------------------------t-jucvij-v--dtk-----nwxadcvtpfeiccsklfpj
fxwtugxkcqhijkhnzmmgd-------------------------------------h---------------------------------s--y--h--of--ael----klqkcjfhketjoufcymoy
twknxzgwoekzfawuqisrw--------------------------------ke--k------------------------------------k-u-ocddezv-------ysamhdfvhsswkcvwuiFd
stxuuayyjvlgswvldbvch-------------cancrgwthjimu-----yjpqptvgfoa-------cfwiuqr---------bgbwrrnkedhbf-------------xnvkjloqqxagyqiyzffi
rwvzdponegzlrlvyhyzio-------------timxq--tihnmz----iplsxy-nsmvwt------gwujjlf--------fwjry----btqfp-------------msnfsecmzlfjasyvsspd
qjwnimadganydvmyetquj-----------tmomx------ndqq---ltol------barug--------ayku--------lzqn-------jwb-------------pnpvzaydxozwkfwtoxzj
agljozuilevkxuijuancd---------------------dubpl---pvha-------awijx-------nnie---------ctno-----zuer-------------mwezglzgjkudtpqiepoi
jeqhnjopqirxddypedecc-------------------sfbage----drjb--------zvij-------vjam----------zvcmkouojg---------------bpdkiFhgzvuxmliugepc
nsklvwhwodftwmmurpjha---------------nbiuafv-------dabz-------xqkvm-------lxlw--------eiaer----lfpon-------------lpuuhnyctewsdzxhtzau
qzdqzeyxtjtuzvfieswmq--------------qkxehs---------aogd-------jqtei-------fidu-------rywtj-------orwp------------feeipoeyamhwjitjoagk
yhnnoligaoivzqhegzgjj-------------owgz------------ysmuk-----snqwa--------ojro-------yhxsf------jhidk------------ooeduuwwggbwbbxozsru
dpvwnbtahycpbzqmtrhxx------------lilksvmqibyfde----mezlqrwcqrla----------emfb--------cbsaocqdqxsftt-o-----------idxicodghozjjyhyoakg
giguckwtjhyhheopczmxc-----------sywlvqogpnsmpns-------fnlhvzjk-----------vboup--------bxtmudbiobd----s----------qdwkpbrrdlbfcguzcwim
aqwjsxllfkquhwgktoelu-------------------------------------------------------s---------hs---b---------nk---------pgnfgaqvtnzwprssqlhr
ffdvzkisntobejkanznqe-tfl-c-------------------------------------------------y-c--tno-----w-------d--------------ajqhhplmgxmfgywrnkpb
eqiraeoxddjowolpjtlhm-jabp-du---------------------------------------------------ef-------------l--------x-r-----ndpuxqxkcnyowzwsrmks
gadgfdbchusybczzhtlkrbowih-g-wi------------------------------------------i--------n---------g----l-------g-t----vmbtxeoktlmgquuvhmnh
clpumycobgydpyqnzvijsvemsq-lacm------------------------------------------------n---r----q--------------n---r----garsyicttuvhzhvylnbm
vtltcdqhzwomhcoxmjczjc-drvobxoc------------------------------------------i--------------t----t-------------o----fneeurfjleugaruytfwy
“Best tool to view png”
tompng5.rb - Spoiler
$ ruby tompng5.rb trick.png > t.rb
$ ruby t.rb trick.png
trick.png
undef p;X=[];class String def-@;replace ?-+dup end;def-a;X.reject!{|x|x.__id__==__id__};a.replace(self+?-+a) end end;at_exit{eval C=
(Zlib.inflate (X*?-).tr(?-,'').tr('q-z','0-9').to_i(26).digits(256).pack'C*')};def method_missing n;(X<<n.to_s)[-1]end;require'zlib'
pghvsnjhoofjrwvjtxqlw---y----b-udb-----------------------------------------------------ufb---m-f--r-------c--e--biazgocgwnpszndfbbck
dyxtcctagqcilhsebalmf--ypf--------r------------------------------------------------------------b----d--uz-l-----ffbozfbtuigyudtfkdnx
jmhluglcuaehejkvovjff------tebo-----s-------------------------------------------------------v----j-----m--b--d--ebwsqqvgxrttypflckmz
oblorqnmdvruvqzfqhrmn-o-----uy----------------------------------------------------------qa--gy-c--j-s--q-c------dqonloqramgtortmnsjq
samuaumugzrletlxbvkta----g-------------------------------------------------------------c---d---q-------v---o--e-opitgsxgmsugemdwvqgq
ckbscuieodvpwnhbauivj--e-i--n--------i---------------------------------------------------c--vl---bb-------m-----cukwrqlloyflvlzxpibt
hjdvffjawdvllwkcldzovr---r----b------------------------------------------------------------x---------------v--ycixmkbvtyqqxcswmkgrdw
qyspivrsabfdvblsarety----q---v---f---------------------epamr-----------------judw----------t------o---ew-d---y--vzmoicxsfehfxntzzqyg
sjukcaolowandodldotxi-------------sygy-----------------tctxp-----------------ibko--------------i------l----a----mdlkytizjgpkjspwrqtu
vogerfbowkuwsqhdeibuf------e------uopq---------------------------------------aoqo-------------q-----r-h-------r-zqiorecrmcbpgjpProtu
uqrgwyktyxxkvplkdbrhu----------whwwuxuumjo--nepthgoehr-aiqco----teqniNhec----cufq-----lpamf----------g------t--uvhxtsqkjuijlwcaywkbu
upwlhderikimkrrmurzpi----------dvvxgodrhgq--xwqsytawos-owmmh---hsfidyuilqks--lzhq--giguob------------vw--v------srnhdhaaravmghesnchk
nhxdggbfbbbsrxxbfrkjx-------------hdik------sggp--------cpsr-odmhd-----mis---hwpP-nxhhl-------------------------dwxivygzsnzfgmtfhunv
qdamzlzqmlwklhyaunljs-------------wzyl------rcm---------xtiv-diiq------------clxiwckjw--------------------------aymchwbafjfrewtzczsk
pspxubmobxbjkweonloyv-------------cfpu------sky---------mzsy-yuwc------------xmiNdhdtnx-------------------------uovolimftfvbcniFupwc
trjtxlusthfmjxbpqnxcf-------------yhvm------dcn--------yteox--lkiN-----mtnn--jqqt---ionfx-----------------------ekdhyvellwsejrvoshqf
gdjhdnrfglhwdrxdndwpy-------------oopcxmal--uwv---ug---zimyh---mitmzrmzlnb---yvuj-----sdem----------------------sbnvasaeqbnrnmgdogrs
yyrdjtprmuriigavmhttl---------------smhyi---r-kh--------oxuu------eokxaj------nr------o-yz-u---yr-k---x---------xxjeexllcydmfdjsnyut
beuthqkuywpofkatgtnsb------------------------------qd-------------------------------------------k-g-vzax--------tcvzgfgvsgffbhjiddvw
ztjzsdtjyaudcildemqhl----------------------------r---k-----t-------------------------------g-ar--c-----q---gl---bjbiNtuklzovxiiotoru
hfkngdjrdtbuxvosvtijm---------------------------------------------------------------------m-w-oab-g-g-x---gh----bnrpayvlgyjenqfylivv
empxoqhntdadikipPorxi--------------------------------v-------a----------------------------sp-g-ah-g--lzmky--y---yabryajvphvicgijypbq
hymaztowwfoowfxzsiyis------------------------f-i-m-m----n----------------------------------i--j-dvvpy-q-jt--r---jiadkbjiuskwjlesyivk
hqmffygttrxjgazatomhp-----------------------------g---g-a--af-------------------------------t-jucvij-v--dtk-----nwxadcvtpfeiccsklfpj
fxwtugxkcqhijkhnzmmgd-------------------------------------h---------------------------------s--y--h--of--ael----klqkcjfhketjoufcymoy
twknxzgwoekzfawuqisrw--------------------------------ke--k------------------------------------k-u-ocddezv-------ysamhdfvhsswkcvwuiFd
stxuuayyjvlgswvldbvch-------------cancrgwthjimu-----yjpqptvgfoa-------cfwiuqr---------bgbwrrnkedhbf-------------xnvkjloqqxagyqiyzffi
rwvzdponegzlrlvyhyzio-------------timxq--tihnmz----iplsxy-nsmvwt------gwujjlf--------fwjry----btqfp-------------msnfsecmzlfjasyvsspd
qjwnimadganydvmyetquj-----------tmomx------ndqq---ltol------barug--------ayku--------lzqn-------jwb-------------pnpvzaydxozwkfwtoxzj
agljozuilevkxuijuancd---------------------dubpl---pvha-------awijx-------nnie---------ctno-----zuer-------------mwezglzgjkudtpqiepoi
jeqhnjopqirxddypedecc-------------------sfbage----drjb--------zvij-------vjam----------zvcmkouojg---------------bpdkiFhgzvuxmliugepc
nsklvwhwodftwmmurpjha---------------nbiuafv-------dabz-------xqkvm-------lxlw--------eiaer----lfpon-------------lpuuhnyctewsdzxhtzau
qzdqzeyxtjtuzvfieswmq--------------qkxehs---------aogd-------jqtei-------fidu-------rywtj-------orwp------------feeipoeyamhwjitjoagk
yhnnoligaoivzqhegzgjj-------------owgz------------ysmuk-----snqwa--------ojro-------yhxsf------jhidk------------ooeduuwwggbwbbxozsru
dpvwnbtahycpbzqmtrhxx------------lilksvmqibyfde----mezlqrwcqrla----------emfb--------cbsaocqdqxsftt-o-----------idxicodghozjjyhyoakg
giguckwtjhyhheopczmxc-----------sywlvqogpnsmpns-------fnlhvzjk-----------vboup--------bxtmudbiobd----s----------qdwkpbrrdlbfcguzcwim
aqwjsxllfkquhwgktoelu-------------------------------------------------------s---------hs---b---------nk---------pgnfgaqvtnzwprssqlhr
ffdvzkisntobejkanznqe-tfl-c-------------------------------------------------y-c--tno-----w-------d--------------ajqhhplmgxmfgywrnkpb
eqiraeoxddjowolpjtlhm-jabp-du---------------------------------------------------ef-------------l--------x-r-----ndpuxqxkcnyowzwsrmks
gadgfdbchusybczzhtlkrbowih-g-wi------------------------------------------i--------n---------g----l-------g-t----vmbtxeoktlmgquuvhmnh
clpumycobgydpyqnzvijsvemsq-lacm------------------------------------------------n---r----q--------------n---r----garsyicttuvhzhvylnbm
vtltcdqhzwomhcoxmjczjc-drvobxoc------------------------------------------i--------------t----t-------------o----fneeurfjleugaruytfwy
• tompng's comment
“Best tool to view png”
tompng5.rb
Winner »
eban eto mame shinh yhara leonid matz AVG.
“Best Spiral”
『最高の螺旋で賞』
Yusuke Endoh
(JP)
6 10 N/A 10 9 9 6 8.33
“Best spiral”
mame2.rb
'';eval(r=%q(->z{r="'';eval(r=¥
%q(#{r}))[%q`#{z}`]";i=-040;30.
times{|n|(15+n%2*15-n/2).times{
r<<r[i+=(1.-n&2)*(32-n%2*31)]}}
i=r[524,0]=?¥0;eval(r[479..-1])
c['"']}))[%q`GFEDCBA"+"[e¥"'"'t
kE*;;¥";" TRICK2018 ";tb,;{{r
2E0$ob[us@*0)[90,336])_#i¥n}s#i
0H}>["t]];};o[1,?¥n*8];ex"-}eac
1Hl<1[-1]*2*t=n%2];o[14-n,0)mvk
8M$<4,?¥n];15.times{|n|;o[35ie2
!Pss.slice!(0,1)+x;sleep(0.0t;0
'W=%q"<<95<<$s<<95;o=->n,x{n.'1
;@[2]}|¥e../,%@s="'%trick2018!8
eval$s=%q_eval($s.gsub!(/#{%@`]
“Best spiral”
mame2.rb - Spoiler
• A Quine that prints itself in spiral manner
– Uses an escape sequence to move the cursor
• The output is rearranged, and contains many
escape sequences, but it is actually executable
• mame's comment
“Best spiral”
mame2.rb - Spoiler
• The first letter of
each line spells out:
“Best spiral”
mame2.rb - Spoiler
'';eval(r=%q(->z{r="'';eval(r=¥
%q(#{r}))[%q`#{z}`]";i=-040;30.
times{|n|(15+n%2*15-n/2).times{
r<<r[i+=(1.-n&2)*(32-n%2*31)]}}
i=r[524,0]=?¥0;eval(r[479..-1])
c['"']}))[%q`GFEDCBA"+"[e¥"'"'t
kE*;;¥";" TRICK2018 ";tb,;{{r
2E0$ob[us@*0)[90,336])_#i¥n}s#i
0H}>["t]];};o[1,?¥n*8];ex"-}eac
1Hl<1[-1]*2*t=n%2];o[14-n,0)mvk
8M$<4,?¥n];15.times{|n|;o[35ie2
!Pss.slice!(0,1)+x;sleep(0.0t;0
'W=%q"<<95<<$s<<95;o=->n,x{n.'1
;@[2]}|¥e../,%@s="'%trick2018!8
eval$s=%q_eval($s.gsub!(/#{%@`]
'';eval(r=%q(->z{r="'';eval(r=¥
%q(#{r}))[%q`#{z}`]";i=-040;30.
times{|n|(15+n%2*15-n/2).times{
r<<r[i+=(1.-n&2)*(32-n%2*31)]}}
i=r[524,0]=?¥0;eval(r[479..-1])
c['"']}))[%q`GFEDCBA"+"[e¥"'"'t
kE*;;¥";" TRICK2018 ";tb,;{{r
2E0$ob[us@*0)[90,336])_#i¥n}s#i
0H}>["t]];};o[1,?¥n*8];ex"-}eac
1Hl<1[-1]*2*t=n%2];o[14-n,0)mvk
8M$<4,?¥n];15.times{|n|;o[35ie2
!Pss.slice!(0,1)+x;sleep(0.0t;0
'W=%q"<<95<<$s<<95;o=->n,x{n.'1
;@[2]}|¥e../,%@s="'%trick2018!8
eval$s=%q_eval($s.gsub!(/#{%@`]
Winner »
eban eto mame shinh yhara leonid matz AVG.
“Most reserved”
『最も予約されていたで賞』
kinaba
(JP)
7 7 10 10 10 10 7 8.71
• Before showing the program…
– kinaba2.rb is a program that does nothing
“Most reserved”
kinaba2.rb
“Most reserved”
FYI: Ruby's reserved words
Ruby Reference Manual: spec/flexical
https://docs.ruby-lang.org/ja/latest/doc/spec=2flexical.html
Here is the list of the reserved words
Reserved words
• A program that consists only of
reserved words of Ruby
“Most reserved”
kinaba2.rb
alias BEGIN for unless def class
super true or return defined? next
break while begin undef do end
rescue then retry else undef module
nil ensure case if yield __LINE__
self and redo elsif not __FILE__
alias END in end when __ENCODING__
end until false end
• A position of the reserved words has
a strong restriction
– must be inside rescue
– / / must be inside loop
– if return then true end #=> SyntaxError (void value
expression)
• Further restriction of "six words pre one line" is
imposed
“Most reserved”
kinaba2.rb - Spoiler
retry rescue
break next redo
if return then true end
#=> SyntaxError (void value expression)
• / / can take reserved words
• / can be used to avoid "void value
expression"
“Most reserved”
kinaba2.rb - Spoiler
def alias undef
if return then true end
#=> SyntaxError (void value expression)
if false or return then true end
#=> no error
alias BEGIN XXX…
or and
• kinaba's last comment
“Most reserved”
kinaba2.rb - Spoiler
Conclusion
Honorable mentions
• Best monkey - Tomoya Ishida (tompng)
• Best abuse of lambda - Shinichiro Hamaji
• Best abuse of meta - Yuki Yugui Sonoda
• Most solvable - Don Yang
• Best layout - Yutaka HARA
• Best abuse of regexp - Benoit Daloze (eregon)
• Most tolerant - Shuichi Tamayose
• Best applause - Colin Fulton
– Enjoy them yourself at the github
Winners & Judges’ awards
6th & eban award: “Most reversible”–Yusuke Endoh
7th: “Best compiler”–Tomoya Ishida
8th & shinh & leonid awrad: “Most composable” – Colin Fulton
9th: “Most (un)readable” – Yutaka HARA
10th & matz award: “Best double meaning” – Tomoya Ishida
11th & eto award: “Most attractive” – Tomoya Ishida
12th & mame award: “Minimum alternative of irb” - Jan Lelis
13th & yhara award: “Most warned” – kinaba
Dishonorable Top Five
“Most reserved”
– kinaba
“Best spiral”
– Yusuke Endoh
“Best png viewer”
– Tomoya Ishida (tompng)
“Best one-liner” – Colin Fulton
“Most three-dimentional” – Tomoya Ishida
4th
5th
Prize?
• Dishonor: the title of “insane”
• Invitation to RubyKaigi 2018
• Top five entries will be checked into the Ruby
official repository in “sample” directory
– Ruby 2.6.0 will have them (perhaps)
General comments
• Judges & winners, say your comments if any
Conclusion
• The winning entries will be published soon at:
• Thank you for all participants!
• See you in the next TRICK "Returns" ???
No k!
http://github.com/tric /trick2018/

TRICK 2018 results

  • 1.
    TRICK 2018 FINAL Results TRICKjudges: mame, eto, shinh, yhara, matz, leonid, eban Transcendental Ruby Imbroglio Contest for RubyKaigi
  • 2.
    Transcendental Ruby Imbroglio Contest for RubyKaigi What’s “TRICK” •A contest for “esoteric” Ruby programming – The most "strange" Ruby program wins – Ruby version of IOCCC (International Obfuscated C Code Contest) Transcendental /ˌtransɛnˈdɛnt(ə)l/ “relating to a spiritual realm” * 「霊的領域に関する」 「世俗を超越した」「超絶技巧」 Imbroglio /ɪmˈbrəʊlɪəʊ/ “an extremely confused, complicated, or embarrassing situation” * 「極めて混乱した、恥ずかしい事態」 * Oxford Dictionaries
  • 3.
    The story sofar • TRICK 2013: “Best pangram” by @kinaba • TRICK 2015: “Best piphilology” by @kinaba • TRICK 2018 is the 3rd and final(!) contest !@THEqQUICKbBROWNfFXjJMPSvVLAZYDGgkyz&[%r{¥"}mosx, 4>6]|?'while(putc 3_0-~$.+=9/2^5;)<18*7and:`# This prints each printable ASCII character exactly once. This contains each printable ASCII character exactly once. big , temp = Array 100000000 ** 0x04e2 3 1 4 1 5. 9 2 6 …
  • 4.
    This talk • Weheld TRICK 2018 FINAL (2018/01/01 – 03/31) • We announce the winners of TRICK 2018
  • 5.
  • 6.
    Judges Yusuke Endoh (@mametter) KoichiroEto (@eto) Shinichiro Hamaji (@shinh) Yutaka Hara (@yhara) Yukihiro Matsumoto (@yukihiro_matz) Sun Park (@sunleonid) Hirofumi Watanabe (@eban)
  • 7.
    Judges eto – Media Artist. –Chairman at NicoNicoGakkai Beta. shinh – The admin of anarchy golf. – IOCCC winner. yhara – The author of Japanese esolang book. matz – The creator of Ruby. leonid – The 1st super Ruby golfer. eban – The 2nd super Ruby golfer. – Full-time Ruby committer at Cookpad. – The world’s No.1 IOCCC player.mame
  • 8.
    Submission statistics • Thankyou for all the submitters! (I’m using 3D pie charts here to obfuscate the precise number of submissions.) JP US DE PL BE
  • 9.
    Honorable mentions • Bestmonkey - Tomoya Ishida (tompng) • Best abuse of lambda - Shinichiro Hamaji • Best abuse of meta - Yuki Yugui Sonoda • Most solvable - Don Yang • Best layout - Yutaka HARA • Best abuse of regexp - Benoit Daloze (eregon) • Most tolerant - Shuichi Tamayose • Best applause - Colin Fulton – Enjoy these entries yourself
  • 10.
    CAUTION • From here,this talk has a lot of spoilers! – Exit now if you want to enjoy analyzing the winners • The winning entries will be published at: No k! http://github.com/tric /trick2018/
  • 11.
  • 12.
    Winner » eban etomame shinh yhara leonid matz AVG. “Most warned” 『最も警告されたで賞』 kinaba (JP) 13th & yhara award N/A 5 7 3 7 4 N/A 5.20
  • 13.
    kinaba.rb • A ten-lineprogram • It prints "TRICK2018" 13th & yhara award “Most warned” def STDOUT.write (s); syswrite s end if def $>.write; end s = Array.new(){}.map{|s|} s << (-"Trick").grapheme_clusters{} [0] # frozen_string_literal: Trick s << ("Ruby".unpack *"ao") [0] s << "#{10**2018 + 1e2018}" [0] s << "#{1>2>3 rescue $!.class.trust.class}"[0] s << "#{true; Kernel.public_class_method}" [0] s << ($ruby.object_id.coerce +2018) [0] result = puts s*"" $ ruby kinaba.rb TRICK2018
  • 14.
    kinaba.rb - Spoiler13th & yhara award “Most warned” $ ruby –w kinaba.rb -:1: warning: parentheses after method name is interpreted as an argument list, not a dec -:2: warning: mismatched indentations at 'end' with 'def' at 1 -:3: warning: shadowing outer local variable - s -:4: warning: `frozen_string_literal' is ignored after any tokens -:5: warning: `*' interpreted as argument prefix -:6: warning: Float 1e2018 out of range -:7: warning: comparison '>' after comparison -:8: warning: unused literal ignored -:9: warning: ambiguous first argument; put parentheses or a space even after `+' operato -:10: warning: assigned but unused variable - result -:1: warning: method redefined; discarding old write -:2: warning: previous definition of write was here -:3: warning: given block not used -:4: warning: passing a block to String#grapheme_clusters is deprecated -:5: warning: unknown unpack directive 'o' in 'ao' -:6: warning: Bignum out of Float range -:7: warning: trust is deprecated and its behavior is same as untaint -:8: warning: public_class_method with no argument is just ignored -:9: warning: global variable `$ruby' not initialized -:10: warning: #<IO:<STDOUT>>.write is outdated interface which accepts just one argument TRICK2018 Each line has static (parse/compile-time) warnings Each line also has dynamic (run-time) warnings
  • 15.
    kinaba.rb - Spoiler •yhara's comment • kinaba's comment 13th & yhara award “Most warned”
  • 16.
    Winner » eban etomame shinh yhara leonid matz AVG. “Minimum alternative of irb” 『最小の irb 代替物で賞』 Jan Lelis (DE) 12th & mametter award N/A 2 8 6 6 6 N/A 5.60
  • 17.
    jan.rb 12th &mametter award “Minimum alternative of irb” eval %w?_="";_ _=binding;l oop( )do $>< <"> >¥s "if $/> _;p uts "=> ¥s%p "%[ __.e val (_+ =get s||exit!) ,_=""];rescu e(Ex cep tio n); put s""+ "¥e [31 m%p ¥e[ 0m"% [$! ,_= ""] if/ d¥se |ee /!~ "#$!"end?*""
  • 18.
    jan.rb - Spoiler •Serves as an interactive Ruby interpreter – Colors an error message – Supports line continuation 12th & mametter award “Minimum alternative of irb” $ ruby jan.rb >> 1 + 2 => 3 >> foo #<NameError: undefined local variable or met >> "Hello," + "world" => "Hello,world"
  • 19.
    jan.rb - Spoiler •Highlight: How to detect line continuation – Try to evaluate the input lines – If it throws an exception, and if its message matches: – the input is considered "unterminated yet" • This Regexp determines if the error is either: 12th & mametter award “Minimum alternative of irb” /d e|ee/ syntax error, unexpected end-of-input unterminated string meets end of file syntax error, unexpected end-of-input unterminated string meets end of file
  • 20.
    jan.rb - Spoiler •mametter's comment – I believe this is the ever shortest implementation of interactive ruby program. – Both the implementation technique and its appearance are so smart. – Thank you for the great program! • Jan's comment 12th & mametter award “Minimum alternative of irb”
  • 21.
    Winner » eban etomame shinh yhara leonid matz AVG. “Most attractive” 『最も魅力的で賞』 Tomoya Ishida (tompng) (JP) 11th & eto award 5 10 8 4 9 8 3 6.71
  • 22.
    tompng.rb 11th &eto award “Most attractive” p,i,u,f,v,q ,h,x=[], Math,->x{i.sin x},->x,y,z{ x*=1.2; r,a,m=(1 -y=y*1.4+0.15)/2+0.1,y+u[3*x+4*y+5*z*=1.2] /12,x* x+z*z; l,s,b= m**0.5,i.atan2(z,x),u[6*a]**2/36+((x*x+z*z)**0.5-r)** 2-(1- a* a)/2 /500;l-= (1-y )/8 *d= (u[ 2*s +3*3*t =1-y- l/2]* u[ 3* s-3*2 * t]) **2/( 1+i. exp( t *10- 9- 5.5 ));e =4*l /( 1+( 0.01+ (1-a=y-d* ( 1 -y) /8)** 2)**0.5 -a)*(1-a * a+((1- a*a)**2+ 0.01 )** 0.5 )** 0.5 ;(i.atan( (1-0.2*i. asin( 0.98* u[+ +5.0 * i. atan2(y= 3*y-3.4,x *=3)] ))*( (0.01+x*x+ y*y )** 0.5-0.1) +4*(0.01+z *z*4 )**0.5-1)* i.atan( a*a+e*e-1-10/(1+(40*m)**10+((a+1)*10)**10))-0.01)*b},%w& MMM## TTTQQBKPTVVpQAk5Y7*pgw43v7*pgaor<*"ggau]/~"gau];-~'ga;,,,.'MerryChristmas!&*'',->x ,y,z, s,m{if(m== 1);g=f [x+=s/2,y+=s/2,z+=s/2];a, b,c=f[x+d=0.01,y,z]-g,f[x,y+d,z]- g,f[x, y,z+d] -g; p<<[x,y,z,a/d=(a*a+b*b+c *c)**0.5,b/d,c/d];else;(r=0 ...n=[m,4].min).map{|i|r.map{ |j|a, b=[f[ x+k =s*i/n,y+l=s*j/n,z+s],f [x+k,y+l,z],f[ x,y+k,z+l],f[x+l,y,z+k],f[x+s,y+k,z+l],f[x+l,y++s, z+k]]. minmax;return 8. times { | i|q[x + s * i [0],y+s *i[1] ,z+s* i[2], s,m/2]}if a*b <0 && s/= 2 }} ; end}, 0,1 .. j=128 (0..7) .each{|i|q[i[ 0] -z= 1.0,i[1 ]-z ,i[2] -z,z,64] ; $><< v[2 *i+64 ,2]};;; sleep 1;loop{ r,s ,m, l,d, w=i.cos( h+=0.02 ),u[ h],i.cos( m= u[ 2.3 *h ]/5),u [++m], x.map {[7]*j}, x. map {[7] *j};;p. each{| x,y ,z,a,b, e| x, z=x *r +s*z,z *r-s* x;y,z =m*y+ l*z ,m *z -l*y;x, y=64* (x+ 1 ),64 *( 1- y ) ;x<j &&y< j&&z< d[x ][ y]&& (d[x][y] ,w [x][ y]=z ,( 8* (1 +( a*r+b+ e*s)/2) /2).floor)};32.times{|i|4.times{|x|w[((u[i**3]+u[h/4+i]/4)*j+x[0])%j][(h/2+u[i*i])%1*j+x[1]]=5}};f=[1,1] $><<27.chr+ ?[+f* ';'+?H+(0..63) .map{|y|x.map{|x| v[w[x-=1 ][2*y]*8+w[x][2*y+ 1]]}.join}*$/}
  • 23.
    tompng.rb - Spoiler11th & eto award “Most attractive”
  • 24.
    tompng.rb - Spoiler11th & eto award “Most attractive” • 3D rendering of X'mas tree in terminal • eto's comment • tompng's comment
  • 25.
    Winner » eban etomame shinh yhara leonid matz AVG. “Best double meaning” 『最高のダブルミーニングで賞』 Tomoya Ishida (tompng) (JP) 10th & matz award 5 3 10 7 7 8 8 6.86
  • 26.
    tompng2.rb 10th &matz award “Best double meaning” • Works as a FizzBuzz-like program $ ruby tompng2.rb 1 2 Ruby 4 Trick Ruby 7 8 Ruby Trick…
  • 27.
    tompng2.rb 10th &matz award “Best double meaning” • Looks like a FizzBuzz program … def fizzbuzz n set_error 'wrong argument type' if n.nil? if n < ​0 n = -n​ retval =​fizzbuzz n return ​​​​​retval else …
  • 28.
    tompng2.rb - Spoiler10th & matz award “Best double meaning” • Contains many Unicode spaces … def ■ fizzbuzz■n set_error 'wrong argument type' if n.nil? if n < ◆0 n = -n​◆ retval =​◆ fizzbuzz■n return ​​◆◆◆◆◆ retval else … ■:U+00A0 No-break Space ◆:U+200B Zero Width Space
  • 29.
    tompng2.rb - Spoiler10th & matz award “Best double meaning” • Looks like a fizzbuzz, and is actually a fizzbuzz • However, the interpretation is completely different than we expect – For example, is not an integer negation, but calls String#-@ (freeze) • Of course, if all Unicode spaces are removed, it also works correctly as we expect! n = -n
  • 30.
    tompng2.rb - Spoiler10th & matz award “Best double meaning” • matz's comment – Rubyは見栄えに気を使う言語です。コードがどのように見 えるか、やりたいことが簡潔に表現できていて、余計なもの を書かずに済むように言語デザイン的に工夫されていま す。しかし、本作品はスペースを有効(?)活用することで、 見栄えと動作を分離することに成功しています。Rubyのパ ワーのひとつの源である「濫用可能な文法」の極致を堪能し てください。 • tompng's comment
  • 31.
    Winner » eban etomame shinh yhara leonid matz AVG. “Most (un)readable” 『最も読みやすい(読みにくい)で賞』 Yutaka HARA (JP) 9th 7 10 7 7 N/A 6 5 7.00
  • 32.
    yhara.rb 9th “Most (un)readable” •A Quine that explains how to work in Japanese def method_missing(n);$*<<n.to_s.bytesize n[-1]=="!" and eval$*.map(&:chr).join;end *自己言及的なプログラム. これは「自己に言及」したQuineプログラムです. 動かすには普通に無引数で実行してください. MRIの最新の安定版で動作確認を行っています. *冒頭の2行が日本語プログラミングのDSLを提供します. Rubyはピリオドまでの部分がメソッド名であると解釈します. そのままではNoMethodErrorになります. それをmethod_missingを使って検知しメソッド名のbytesizeをASCIIコードとして文字にします. メソッド名が半角の!で終わる場合、記憶した文字たちをjoinしてevalします. これにより任意のRubyプログラムを日本語により記述することができます. このプログラムの場合はこのファイルをreadし出力するようになっています. *Note:文の長さは注意が必要. UTF_8の日本語は1文字が3bytes. 端数が丁度になるよう英語を入れる. 以上、自己言及的programでした!
  • 33.
    yhara.rb - Spoiler9th “Most (un)readable” *自己言及的なプログラム. これは「自己に言及」したQuineプログラムです. 動かすには普通に無引数で実行してください. MRIの最新の安定版で動作確認を行っています. byte length 36 62 60 60 $ > < < ASCII code method calls (hooked by method_missing) eval'ed code $><<IO.read($0)
  • 34.
  • 35.
    Winner » eban etomame shinh yhara leonid matz AVG. “Best compiler” 『最高のコンパイラで賞』 Tomoya Ishida (tompng) (JP) 8th 7 2 9 9 8 9 7 7.29
  • 36.
    tompng3.rb 8th “Best compiler” (B||=[])<<6;C||=[];C<<%w@0if@; a=?;*2018;C<<%w@2 (e=ARGV[0]);e=File.read@; t=->(i,s){s&&a[i.to_i,s.size]=s};C<<%w@25 (e)if@; u=->{C.map{|i,s|t[i,s]};eval(a)};C<<%w@30 (/^¥.+$@; at_exit{_,u=u,->{};_[]};C<<%w@37 /!~e&&File.exist?(@; C<<%w@55 e));d='[><+-,.]';i=32.chr;f=0..79;c=(0..7).m@; C<<%w@99 ap{|c|b=['C||=[];','a=?;*2018;','t=->(i,s){s@; C<<%w@143 &&a[i.to_i,s.size]=s};','u=->{C.map{|i,s|t[i,@; C<<%w@188 s]};eval(a)};','at_exit{_,u=u,->{};_[]};'];o=@; C<<%w@233 0;f.map{|f|j=(0..67).map{|r|r-=34;s=f-34;m,n=@; C<<%w@278 r.abs,s.abs;h=->x{m<25&&n<34&&(x<0||n>17)};q=@; C<<%w@323 ->x{n<x+34&&x<n&&n<34};[h[r],q[-r],q[r],n<11|@; C<<%w@368 |(m<17&&n<34),n<12,r**4*1.6+16*(s-25)**4<8*17@; C<<%w@413 **4||(s>37&&s>17-r&&4*s<173-r),r**4+16*(s-25)@; C<<%w@458 **4<8*17**4,h[-r]][c]};r,p=j.index(!!0),j.cou@; C<<%w@503 nt(!!0);next(i*68)if(!r);k=f==45?'(B||=[])<<'@; C<<%w@548 +c.to_s+?;:'';g=b[0];(k+=b.shift)if(g&&g.size@; C<<%w@593 <=p-k.size);l=p-k.size-o.to_s.size-9;s=64.chr@; C<<%w@638 ;if(l>0);k+=['C<<%w',s,o,i,a[o,l],s,?;]*'';o+@; C<<%w@683 =l;end;(i*r)+k+?;*([p-k.size,0].max)+i*(68-r-@; C<<%w@728 p)}};(e.chars-(e.chars-d.chars)).each_slice(8@; C<<%w@773 ){|l|puts(f.map{|y|l.map{|r|c[d.index(r)][y]}@; C<<%w@818 .*(i*17).rstrip});4.times{puts};};else;x,i=@; C<<%w@861 Hash.new{0},0;y=%(while(x[i]!=0);i+=1;i-=1;@; C<<%w@904 x[i]+=1;x[i]-=1;x[i]=($<.binmode.getc||0)@; C<<%w@945 .ord;$><<(x[i]&0xff).chr;end).split(?;)@; C<<%w@984 ;eval(B.map{|a|y[a]}*?;);end;;;;;;;;;@; C<<%w@1021 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;@; C<<%w@1051 ;;;;;;;;;;;;;;;;;;@;
  • 37.
    tompng3.rb - Spoiler8th “Best compiler”
  • 38.
    tompng3.rb - Spoiler8th “Best compiler” • Brainf*ck to Ruby compiler ✓ The Ruby code works as the original Brainf*ck code ✓ The Ruby code shapes like the original Brainf*ck code ✓ The Ruby code works as the compiler if a file is given ✓ (Hard-coded font data is cute) ++++[->+ +++[->++ +++++>++ +<<]<]>> compile Brainf*ck code Ruby code
  • 39.
    tompng3.rb - Spoiler8th “Best compiler” • tompng's comment
  • 40.
    Winner » eban etomame shinh yhara leonid matz AVG. “Most composable” 『最も組合せ可能で賞』 Colin Fulton (US) 7th & shinh award & leonid award 5 4 9 10 9 10 4 7.29
  • 41.
    justcolin.rb 7th &shinh award & leonid award “Most composable” $l||=__LINE__;eval q=%q[k =";eval q=%q"; ######## (c) 2018 (MIT License) ######## ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z (y=->{z=puts(z.map &:rstrip)})&&(s="")&& e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
  • 42.
    justcolin.rb - Spoiler7th & shinh award & leonid award “Most composable” $l||=__LINE__;eval q=%q[k =";eval q=%q";$l||=__LINE__;eval q=%q[k =";eval q=%q"; ######## (c) 2018 (MIT License) ################ (c) 2018 (MIT License) ######## ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z (y=->{z=puts(z.map &:rstrip)})&&(s="")&&(y=->{z=puts(z.map &:rstrip)})&&(s="")&& e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)};h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr};x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]};$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}];at_exit{b=b&&($z||81.times(&u)&&$z=1)}] $l||=__LINE__;eval q=%q[k =";eval q=%q"; $l||=__LINE__;eval q=%q[k =";eval q=%q"; ######## (c) 2018 (MIT License) ######## ######## (c) 2018 (MIT License) ######## ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z (y=->{z=puts(z.map &:rstrip)})&&(s="")&& (y=->{z=puts(z.map &:rstrip)})&&(s="")&& e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}] ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}] $l||=__LINE__;eval q=%q[k =";eval q=%q"; ######## (c) 2018 (MIT License) ######## ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z (y=->{z=puts(z.map &:rstrip)})&&(s="")&& e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
  • 43.
    justcolin.rb - Spoiler7th & shinh award & leonid award “Most composable” $l||=__LINE__;eval q=%q[k =";eval q=%q";$l||=__LINE__;eval q=%q[k =";eval q=%q"; ######## (c) 2018 (MIT License) ################ (c) 2018 (MIT License) ######## ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z (y=->{z=puts(z.map &:rstrip)})&&(s="")&&(y=->{z=puts(z.map &:rstrip)})&&(s="")&& e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)};h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr};x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]};$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}];at_exit{b=b&&($z||81.times(&u)&&$z=1)}] $l||=__LINE__;eval q=%q[k =";eval q=%q";$l||=__LINE__;eval q=%q[k =";eval q=%q"; ######## (c) 2018 (MIT License) ################ (c) 2018 (MIT License) ######## ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z (y=->{z=puts(z.map &:rstrip)})&&(s="")&&(y=->{z=puts(z.map &:rstrip)})&&(s="")&& e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)};h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr};x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]};$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}];at_exit{b=b&&($z||81.times(&u)&&$z=1)}] $l||=__LINE__;eval q=%q[k =";eval q=%q"; ######## (c) 2018 (MIT License) ######## ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z (y=->{z=puts(z.map &:rstrip)})&&(s="")&& e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
  • 44.
    justcolin.rb - Spoiler7th & shinh award & leonid award “Most composable” $l||=__LINE__;eval q=%q[k =";eval q=%q";$l||=__LINE__;eval q=%q[k =";eval q=%q";$l||=__LINE__;eval q=%q[k =";eval q=%q"; ######## (c) 2018 (MIT License) ################ (c) 2018 (MIT License) ################ (c) 2018 (MIT License) ######## ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z (y=->{z=puts(z.map &:rstrip)})&&(s="")&&(y=->{z=puts(z.map &:rstrip)})&&(s="")&&(y=->{z=puts(z.map &:rstrip)})&&(s="")&& e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)};h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)};h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr};x=->{"$l||=__LINE__"+k+91.chr+q+93.chr};x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]};$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]};$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}];at_exit{b=b&&($z||81.times(&u)&&$z=1)}];at_exit{b=b&&($z||81.times(&u)&&$z=1)}] $l||=__LINE__;eval q=%q[k =";eval q=%q"; ######## (c) 2018 (MIT License) ######## ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z (y=->{z=puts(z.map &:rstrip)})&&(s="")&& e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}] $l||=__LINE__;eval q=%q[k =";eval q=%q"; ######## (c) 2018 (MIT License) ######## ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z (y=->{z=puts(z.map &:rstrip)})&&(s="")&& e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
  • 45.
    justcolin.rb - Spoiler7th & shinh award & leonid award “Most composable” $l||=__LINE__;eval q=%q[k =";eval q=%q"; ######## (c) 2018 (MIT License) ######## ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z (y=->{z=puts(z.map &:rstrip)})&&(s="")&& e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}] $l||=__LINE__;eval q=%q[k =";eval q=%q";$l||=__LINE__;eval q=%q[k =";eval q=%q"; ######## (c) 2018 (MIT License) ################ (c) 2018 (MIT License) ######## ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s="");$r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%;;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z (y=->{z=puts(z.map &:rstrip)})&&(s="")&&(y=->{z=puts(z.map &:rstrip)})&&(s="")&& e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42;e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)};h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&&(r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!||c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}};g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr};x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$;b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) &&(v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && w=->i{z ?z.zip(v[i]) .map(&:join):v[i]};w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]};$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}];at_exit{b=b&&($z||81.times(&u)&&$z=1)}] $l||=__LINE__;eval q=%q[k =";eval q=%q"; $l||=__LINE__;eval q=%q[k =";eval q=%q"; ######## (c) 2018 (MIT License) ######## ######## (c) 2018 (MIT License) ######## ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 ;n=([1]);f=->s{[0]*(s.size/40)};$c||=-17 $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); $r=[*$r]+[[]]*(($l-$c)/18);$c=$l;(s=""); ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;m=->a,b{8+4*a[b]};$r[ -1]+=f[s]+n;s=%; ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z ;;s&&$r[-1]=f[s]+$r[-1]||(z=44);z=$l=s=z (y=->{z=puts(z.map &:rstrip)})&&(s="")&& (y=->{z=puts(z.map &:rstrip)})&&(s="")&& e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; e=->a,b,c{(a+a)[b+c]+a[b-c]};$r||=$r*42; ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} ;h=[1,*8..10];f=->a,l{a+[0] *(l-a.size)} (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& (r||=->{f[$r.flat_map{|a|f[a,9]},81]})&& c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| c=->a,d{h.map{|p|e[a,d,p]}.sum};!nil.!|| g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; g=->a{d=-1;a. map{(m[a,d+=1])[c[a,d]]}}; ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} ;x=->{"$l||=__LINE__"+k+91.chr+q+93.chr} b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; b=->{x[].split(?¥n).map{|s|s[$t]}}||!$$; (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && (v=->i{g[r[]][i]>0?b[]: [" "*40]*18}) && w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; w=->i{z ?z.zip(v[i]) .map(&:join):v[i]}; ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;$t=/¥S.{0,39}/;u=->i{z=w[i];i%9>7&&y[]} ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}] ;at_exit{b=b&&($z||81.times(&u)&&$z=1)}]
  • 46.
    justcolin.rb - Spoiler7th & shinh award & leonid award “Most composable” • Works as a cell of "the Game of Life" – You can copy and paste it as a cell – The composed program print the next generation • Highlight: How to detect which cell is filled or not – Y-coordinate: – X-coordinate: • Another highlight: Very fragmented code – To make it vertically composable, no block ranges multi- line __LINE__ ;;……s=%; (spaces) ;;……s=%;
  • 47.
    justcolin.rb - Spoiler7th & shinh award & leonid award “Most composable” • leonid's comment – Box-shaped code that can stack: Fascinating. – It's also a quine: Incredible. – It's a dot in the Game of Life: AMAZING! • shinh's comment • justcolin's comment
  • 48.
    Winner » eban etomame shinh yhara leonid matz AVG. “Most reversible” 『最もリバーシブルで賞』 Yusuke Endoh (JP) 6th & eban award 9 7 N/A 9 8 8 4 7.33
  • 49.
    mame.rb 6th &eban award “Most reversible” • A sorting program a,b=:reverse,:itself;b=b a=b=:itself;b r||=->s,m=a{s.send(m)};a puts r[$<.sort_by(&r),b] ;r||=->s,m=a{s.send(m)}; a=b=:reverse;0 b,a=:reverse,:itself# $ cat input.txt 3 2 1 $ ruby mame.rb input.txt 1 2 3
  • 50.
    mame.rb - Spoiler6th & eban award “Most reversible” – yields a reverse-sort program – yields a program that sorts by reversed lines – yields a program that reverse-sorts by reversed lines – yields the original sorting program ruby mame.rb mame.rb > rsort.rb ruby rsort.rb rsort.rb > sortr.rb ruby sortr.rb sortr.rb > rsortr.rb ruby rsortr.rb rsortr.rb > mame2.rb
  • 51.
    mame.rb - Spoiler6th & eban award “Most reversible” • eban's comment • mame's comment
  • 52.
  • 53.
    Winner » eban etomame shinh yhara leonid matz AVG. “Most three-dimentional” 『最も立体的で賞』 Tomoya Ishida (tompng) (JP) 8 8 8 6 9 8 6 7.57
  • 54.
    “Most three-dimentional” tompng4.rb X=[];def self.method_missingn;n.to_s.chars;end l=[];def l.-a;X<<a=[nil,*a];a;end;def l.+a;self-a;end class Array;def-@;[]-self;end;def-a;replace [*self,nil,*a ]end;alias +@ -@;alias + -;end;def gen3d f;yield;b=['solid obj'];w, h=X[0].size,X.size;X<<[];a=->r,z,dr,dz{;r-=w/2.0;z*=2;r2,z2=r+dr,z+dz*2;if r>0||r2> 0;r=[0,r].max;r2=[0,r2].max;16.times{|i|m=Math;p=m::PI/8;;c,s=m.cos(t=i*p),m.sin(t) c2,s2=m.cos(t=(i+1)*p),m.sin(t);t-=p/2;[[0,1,2],[0,2,3]].map{|a|b.push [:facet,'n'+ + 'ormal',dz*m.cos(t),dz*m.sin(t),-dr]*' ','outer loop',a.map{|i|'v'+ ++ "ertex #{[[r*c,r*s,z],[r*c2,r*s2,z],[r2*c2,r2*s2,z2],[r2* +c, r2*s,z2]][i]*' '}"},:endloop,:endfacet}}end};(0...h). map{| y|w.times{|x|[X[y-1][x]||a[x,y,1,0],X[y+1][x]|| a[x+1,y+ 1,-1,0],X[ y][x-+1]||a[ x,y+1,0,-1],X[y ][x++1]||a[x+1,y, 0,1]]if X[y][x]}} s=[b,'end'+b[0]]* $/;File.write(f, s);X.replace( []);end gen3d 'wine_glass.stl' do l--ww------------------ww--l l--ww------------------ww--l l--ww++++++++++++++++++ww--l l--ww++++++++++++++++++ww--l l--ww++++++++++++++++++ww--l l--ww++++++++++++++++++ww--l l---ww++++++++++++++++ww---l l----www++++++++++++www----l l------www++++++++www------l l--------wwwwwwwwww--------l l-----------wwww-----------l l------------ww------------l l------------ww------------l l------------ww------------l l-----------wwww-----------l l---------wwwwwwww---------l l----wwwwwwwwwwwwwwwwww----l end
  • 55.
    • Generates 3Dmodel data of "solid of revolution" • The shape is configurable by the DSL “Most three-dimentional” tompng4.rb - Spoiler $ ruby tompng4.rb > wine_glass.stl gen3d 'ochoko.stl' do l------------------------l l-ww------------------ww-l l-ww------------------ww-l l-ww++++++++++++++++++ww-l l-ww++++++++++++++++++ww-l l--ww++++++++++++++++ww--l l---wwww++++++++++wwww---l l----wwwwwwwwwwwwwwww----l l----www----------www----l end
  • 56.
    • Tompng's comment “Mostthree-dimentional” tompng4.rb
  • 57.
    Winner » eban etomame shinh yhara leonid matz AVG. “Best one-liner” 『最高のワンライナーで賞』 Colin Fulton (US) 6 9 8 6 7 7 10 7.57
  • 58.
    “Best one-liner” justcolin2.rb • One-liner $🚀=0;def🤔 🏷,🤔=0,&b;puts ' '*$🚀+( 🤔 ?"":"🚫 ")+🏷;$🚀+=4;b&.[];$🚀-=4;end
  • 59.
    “Best one-liner” justcolin2.rb -Spoiler • 68-character test framework require './justcolin2' 🤔 "Math" do 🤔 "Addition" do 🤔 "One plus one equals two.", 1+1 == 2 🤔 "One plus one equals eleven.", 1+1 == 11 end end $ ruby test.rb Math Addition One plus one equals two. 🚫 One plus one equals eleven.
  • 60.
  • 61.
  • 62.
    Winner » eban etomame shinh yhara leonid matz AVG. “Best png viewer” 『最高の png のビューアで賞』 Tomoya Ishida (Japan) 8 8 8 7 8 6 9 7.71
  • 63.
    “Best tool toview png” tompng5.rb X=[];class String def-@;replace ?-+self end;def-a;X.reject!{|x|x. __id__==__id__};a.replace(self+?-+a) end end;at_exit{eval C=(Zlib .inflate Integer((X*?-).tr(?-,'').tr('q-z','0-9'),26).digits(256) .pack'C*')};def method_missing n;(X<<n.to_s)[-1]end;require'zlib' fzygtoxyzgntmdmuwvfoffbpmvzojpkhczvjvjdbtscnldwbdoprackddovivvmkz ponzmosvtjciwkgaslscxxxwudeesmmqpfhislxuxnnypulxstzgobyaekqqhbjcg mvko------------ddkeys----eivhnccaqyiw---bzyccmt-----------ymtnge jwhi--------------pjxf------mdarbtumnv---qasda--------------gmwdt wrtk---qtpzgnce----fsl-------fkgzgtbpp---gwnm----pxkpqkdiw---owga momz---yjjvpnvar---zeo---v-----duvalwu---nsqt---waofemwakivnyqkjd fzag---uhvusmkl----kzb---rhc----iutzjr---mqlh---ayijpwativpweaato xexs--------------rvgv---pjdz-----lkkg---uiaw---lovitupw-----fwmn kfru------------jvjpgv---jskycf----pal---gbuf---hfdnywog-----iuca pntn---apmkqroeuzwuwkw---gqnmgof-----b---hlpl---vkkyhfyrqfr--jwrl kmdb---dhspujhmtgrkccu---uonfummdt-------rqfw----bpiactehwp--fncq yzvz---gdaxebplhfndran---ytfmviryeh------hqwkl---------------nced bibu---fnkdthgldhkxxjg---rwnmpudhbqin----gucoyki------------hfura cqdgqpyzqfzknvdjoxxhpjulwwyebtocxdrvklbuviwwcatlmdosxfvwntzbijguy iglrvvzlxerflupxvsyujfacuwhrvmnecgtewtqkhtdggcltejiyqcluclkycwvzg vvxfysvttfbeglvrlngntdngzyhqrmltazwdydxrsvjploembhgxdvfmmhepbschm brn--iqrcdb--evv----tqp------lg--uein-wzut--mr------wkh------foqz zsf--srjnjp--ampb--pfio--hgtekx--rrr---fwd--jn--xqkezcz--vsb--nya khrc--evlr--oioxs--mqce--bqfmag--bwz---xda--qw--jnuzelr--qzi--itx mdxd--duso--wxbot--nmon--ugnbdpc--a--c--e--hlg--twxndre--tby--rhg evhbn--zb--dtxmiz--dpia------vie--h--i--t--shh------kfn------owna ealmt--kb--scxdjy--smvl--dqmgebk--t--s--t--gfd--updcbnc--rh--dwwp dvpnxb----wpljjdy--kolc--qflyleok---xkv---usbj--jhrawbn--ewx--bgf eaqwrw----ejwxhet--dice--eoczconm---urz---rqyp--hovvvfc--bskj--el aocjcts--jtumwxm----mgy------xpaoq-jtwqr-aipay------dhy--iync--hk sckddmvuvvuhhqstumaykvczaaujrumqbbqsdvdycplyrlkkojlxnkrhbbrmnjxyf cdtcmpfmjvthwkpzucbblttgumomlxnxwjeypfeagaukfzeokzxjebkpigcvlqnso
  • 64.
    “Best tool toview png” tompng5.rb - Spoiler $ ruby tompng5.rb trick.pngtrick.png undef p;X=[];class String def-@;replace ?-+dup end;def-a;X.reject!{|x|x.__id__==__id__};a.replace(self+?-+a) end end;at_exit{eval C= (Zlib.inflate (X*?-).tr(?-,'').tr('q-z','0-9').to_i(26).digits(256).pack'C*')};def method_missing n;(X<<n.to_s)[-1]end;require'zlib' pghvsnjhoofjrwvjtxqlw---y----b-udb-----------------------------------------------------ufb---m-f--r-------c--e--biazgocgwnpszndfbbck dyxtcctagqcilhsebalmf--ypf--------r------------------------------------------------------------b----d--uz-l-----ffbozfbtuigyudtfkdnx jmhluglcuaehejkvovjff------tebo-----s-------------------------------------------------------v----j-----m--b--d--ebwsqqvgxrttypflckmz oblorqnmdvruvqzfqhrmn-o-----uy----------------------------------------------------------qa--gy-c--j-s--q-c------dqonloqramgtortmnsjq samuaumugzrletlxbvkta----g-------------------------------------------------------------c---d---q-------v---o--e-opitgsxgmsugemdwvqgq ckbscuieodvpwnhbauivj--e-i--n--------i---------------------------------------------------c--vl---bb-------m-----cukwrqlloyflvlzxpibt hjdvffjawdvllwkcldzovr---r----b------------------------------------------------------------x---------------v--ycixmkbvtyqqxcswmkgrdw qyspivrsabfdvblsarety----q---v---f---------------------epamr-----------------judw----------t------o---ew-d---y--vzmoicxsfehfxntzzqyg sjukcaolowandodldotxi-------------sygy-----------------tctxp-----------------ibko--------------i------l----a----mdlkytizjgpkjspwrqtu vogerfbowkuwsqhdeibuf------e------uopq---------------------------------------aoqo-------------q-----r-h-------r-zqiorecrmcbpgjpProtu uqrgwyktyxxkvplkdbrhu----------whwwuxuumjo--nepthgoehr-aiqco----teqniNhec----cufq-----lpamf----------g------t--uvhxtsqkjuijlwcaywkbu upwlhderikimkrrmurzpi----------dvvxgodrhgq--xwqsytawos-owmmh---hsfidyuilqks--lzhq--giguob------------vw--v------srnhdhaaravmghesnchk nhxdggbfbbbsrxxbfrkjx-------------hdik------sggp--------cpsr-odmhd-----mis---hwpP-nxhhl-------------------------dwxivygzsnzfgmtfhunv qdamzlzqmlwklhyaunljs-------------wzyl------rcm---------xtiv-diiq------------clxiwckjw--------------------------aymchwbafjfrewtzczsk pspxubmobxbjkweonloyv-------------cfpu------sky---------mzsy-yuwc------------xmiNdhdtnx-------------------------uovolimftfvbcniFupwc trjtxlusthfmjxbpqnxcf-------------yhvm------dcn--------yteox--lkiN-----mtnn--jqqt---ionfx-----------------------ekdhyvellwsejrvoshqf gdjhdnrfglhwdrxdndwpy-------------oopcxmal--uwv---ug---zimyh---mitmzrmzlnb---yvuj-----sdem----------------------sbnvasaeqbnrnmgdogrs yyrdjtprmuriigavmhttl---------------smhyi---r-kh--------oxuu------eokxaj------nr------o-yz-u---yr-k---x---------xxjeexllcydmfdjsnyut beuthqkuywpofkatgtnsb------------------------------qd-------------------------------------------k-g-vzax--------tcvzgfgvsgffbhjiddvw ztjzsdtjyaudcildemqhl----------------------------r---k-----t-------------------------------g-ar--c-----q---gl---bjbiNtuklzovxiiotoru hfkngdjrdtbuxvosvtijm---------------------------------------------------------------------m-w-oab-g-g-x---gh----bnrpayvlgyjenqfylivv empxoqhntdadikipPorxi--------------------------------v-------a----------------------------sp-g-ah-g--lzmky--y---yabryajvphvicgijypbq hymaztowwfoowfxzsiyis------------------------f-i-m-m----n----------------------------------i--j-dvvpy-q-jt--r---jiadkbjiuskwjlesyivk hqmffygttrxjgazatomhp-----------------------------g---g-a--af-------------------------------t-jucvij-v--dtk-----nwxadcvtpfeiccsklfpj fxwtugxkcqhijkhnzmmgd-------------------------------------h---------------------------------s--y--h--of--ael----klqkcjfhketjoufcymoy twknxzgwoekzfawuqisrw--------------------------------ke--k------------------------------------k-u-ocddezv-------ysamhdfvhsswkcvwuiFd stxuuayyjvlgswvldbvch-------------cancrgwthjimu-----yjpqptvgfoa-------cfwiuqr---------bgbwrrnkedhbf-------------xnvkjloqqxagyqiyzffi rwvzdponegzlrlvyhyzio-------------timxq--tihnmz----iplsxy-nsmvwt------gwujjlf--------fwjry----btqfp-------------msnfsecmzlfjasyvsspd qjwnimadganydvmyetquj-----------tmomx------ndqq---ltol------barug--------ayku--------lzqn-------jwb-------------pnpvzaydxozwkfwtoxzj agljozuilevkxuijuancd---------------------dubpl---pvha-------awijx-------nnie---------ctno-----zuer-------------mwezglzgjkudtpqiepoi jeqhnjopqirxddypedecc-------------------sfbage----drjb--------zvij-------vjam----------zvcmkouojg---------------bpdkiFhgzvuxmliugepc nsklvwhwodftwmmurpjha---------------nbiuafv-------dabz-------xqkvm-------lxlw--------eiaer----lfpon-------------lpuuhnyctewsdzxhtzau qzdqzeyxtjtuzvfieswmq--------------qkxehs---------aogd-------jqtei-------fidu-------rywtj-------orwp------------feeipoeyamhwjitjoagk yhnnoligaoivzqhegzgjj-------------owgz------------ysmuk-----snqwa--------ojro-------yhxsf------jhidk------------ooeduuwwggbwbbxozsru dpvwnbtahycpbzqmtrhxx------------lilksvmqibyfde----mezlqrwcqrla----------emfb--------cbsaocqdqxsftt-o-----------idxicodghozjjyhyoakg giguckwtjhyhheopczmxc-----------sywlvqogpnsmpns-------fnlhvzjk-----------vboup--------bxtmudbiobd----s----------qdwkpbrrdlbfcguzcwim aqwjsxllfkquhwgktoelu-------------------------------------------------------s---------hs---b---------nk---------pgnfgaqvtnzwprssqlhr ffdvzkisntobejkanznqe-tfl-c-------------------------------------------------y-c--tno-----w-------d--------------ajqhhplmgxmfgywrnkpb eqiraeoxddjowolpjtlhm-jabp-du---------------------------------------------------ef-------------l--------x-r-----ndpuxqxkcnyowzwsrmks gadgfdbchusybczzhtlkrbowih-g-wi------------------------------------------i--------n---------g----l-------g-t----vmbtxeoktlmgquuvhmnh clpumycobgydpyqnzvijsvemsq-lacm------------------------------------------------n---r----q--------------n---r----garsyicttuvhzhvylnbm vtltcdqhzwomhcoxmjczjc-drvobxoc------------------------------------------i--------------t----t-------------o----fneeurfjleugaruytfwy
  • 65.
    “Best tool toview png” tompng5.rb - Spoiler $ ruby tompng5.rb trick.png > t.rb $ ruby t.rb trick.png trick.png undef p;X=[];class String def-@;replace ?-+dup end;def-a;X.reject!{|x|x.__id__==__id__};a.replace(self+?-+a) end end;at_exit{eval C= (Zlib.inflate (X*?-).tr(?-,'').tr('q-z','0-9').to_i(26).digits(256).pack'C*')};def method_missing n;(X<<n.to_s)[-1]end;require'zlib' pghvsnjhoofjrwvjtxqlw---y----b-udb-----------------------------------------------------ufb---m-f--r-------c--e--biazgocgwnpszndfbbck dyxtcctagqcilhsebalmf--ypf--------r------------------------------------------------------------b----d--uz-l-----ffbozfbtuigyudtfkdnx jmhluglcuaehejkvovjff------tebo-----s-------------------------------------------------------v----j-----m--b--d--ebwsqqvgxrttypflckmz oblorqnmdvruvqzfqhrmn-o-----uy----------------------------------------------------------qa--gy-c--j-s--q-c------dqonloqramgtortmnsjq samuaumugzrletlxbvkta----g-------------------------------------------------------------c---d---q-------v---o--e-opitgsxgmsugemdwvqgq ckbscuieodvpwnhbauivj--e-i--n--------i---------------------------------------------------c--vl---bb-------m-----cukwrqlloyflvlzxpibt hjdvffjawdvllwkcldzovr---r----b------------------------------------------------------------x---------------v--ycixmkbvtyqqxcswmkgrdw qyspivrsabfdvblsarety----q---v---f---------------------epamr-----------------judw----------t------o---ew-d---y--vzmoicxsfehfxntzzqyg sjukcaolowandodldotxi-------------sygy-----------------tctxp-----------------ibko--------------i------l----a----mdlkytizjgpkjspwrqtu vogerfbowkuwsqhdeibuf------e------uopq---------------------------------------aoqo-------------q-----r-h-------r-zqiorecrmcbpgjpProtu uqrgwyktyxxkvplkdbrhu----------whwwuxuumjo--nepthgoehr-aiqco----teqniNhec----cufq-----lpamf----------g------t--uvhxtsqkjuijlwcaywkbu upwlhderikimkrrmurzpi----------dvvxgodrhgq--xwqsytawos-owmmh---hsfidyuilqks--lzhq--giguob------------vw--v------srnhdhaaravmghesnchk nhxdggbfbbbsrxxbfrkjx-------------hdik------sggp--------cpsr-odmhd-----mis---hwpP-nxhhl-------------------------dwxivygzsnzfgmtfhunv qdamzlzqmlwklhyaunljs-------------wzyl------rcm---------xtiv-diiq------------clxiwckjw--------------------------aymchwbafjfrewtzczsk pspxubmobxbjkweonloyv-------------cfpu------sky---------mzsy-yuwc------------xmiNdhdtnx-------------------------uovolimftfvbcniFupwc trjtxlusthfmjxbpqnxcf-------------yhvm------dcn--------yteox--lkiN-----mtnn--jqqt---ionfx-----------------------ekdhyvellwsejrvoshqf gdjhdnrfglhwdrxdndwpy-------------oopcxmal--uwv---ug---zimyh---mitmzrmzlnb---yvuj-----sdem----------------------sbnvasaeqbnrnmgdogrs yyrdjtprmuriigavmhttl---------------smhyi---r-kh--------oxuu------eokxaj------nr------o-yz-u---yr-k---x---------xxjeexllcydmfdjsnyut beuthqkuywpofkatgtnsb------------------------------qd-------------------------------------------k-g-vzax--------tcvzgfgvsgffbhjiddvw ztjzsdtjyaudcildemqhl----------------------------r---k-----t-------------------------------g-ar--c-----q---gl---bjbiNtuklzovxiiotoru hfkngdjrdtbuxvosvtijm---------------------------------------------------------------------m-w-oab-g-g-x---gh----bnrpayvlgyjenqfylivv empxoqhntdadikipPorxi--------------------------------v-------a----------------------------sp-g-ah-g--lzmky--y---yabryajvphvicgijypbq hymaztowwfoowfxzsiyis------------------------f-i-m-m----n----------------------------------i--j-dvvpy-q-jt--r---jiadkbjiuskwjlesyivk hqmffygttrxjgazatomhp-----------------------------g---g-a--af-------------------------------t-jucvij-v--dtk-----nwxadcvtpfeiccsklfpj fxwtugxkcqhijkhnzmmgd-------------------------------------h---------------------------------s--y--h--of--ael----klqkcjfhketjoufcymoy twknxzgwoekzfawuqisrw--------------------------------ke--k------------------------------------k-u-ocddezv-------ysamhdfvhsswkcvwuiFd stxuuayyjvlgswvldbvch-------------cancrgwthjimu-----yjpqptvgfoa-------cfwiuqr---------bgbwrrnkedhbf-------------xnvkjloqqxagyqiyzffi rwvzdponegzlrlvyhyzio-------------timxq--tihnmz----iplsxy-nsmvwt------gwujjlf--------fwjry----btqfp-------------msnfsecmzlfjasyvsspd qjwnimadganydvmyetquj-----------tmomx------ndqq---ltol------barug--------ayku--------lzqn-------jwb-------------pnpvzaydxozwkfwtoxzj agljozuilevkxuijuancd---------------------dubpl---pvha-------awijx-------nnie---------ctno-----zuer-------------mwezglzgjkudtpqiepoi jeqhnjopqirxddypedecc-------------------sfbage----drjb--------zvij-------vjam----------zvcmkouojg---------------bpdkiFhgzvuxmliugepc nsklvwhwodftwmmurpjha---------------nbiuafv-------dabz-------xqkvm-------lxlw--------eiaer----lfpon-------------lpuuhnyctewsdzxhtzau qzdqzeyxtjtuzvfieswmq--------------qkxehs---------aogd-------jqtei-------fidu-------rywtj-------orwp------------feeipoeyamhwjitjoagk yhnnoligaoivzqhegzgjj-------------owgz------------ysmuk-----snqwa--------ojro-------yhxsf------jhidk------------ooeduuwwggbwbbxozsru dpvwnbtahycpbzqmtrhxx------------lilksvmqibyfde----mezlqrwcqrla----------emfb--------cbsaocqdqxsftt-o-----------idxicodghozjjyhyoakg giguckwtjhyhheopczmxc-----------sywlvqogpnsmpns-------fnlhvzjk-----------vboup--------bxtmudbiobd----s----------qdwkpbrrdlbfcguzcwim aqwjsxllfkquhwgktoelu-------------------------------------------------------s---------hs---b---------nk---------pgnfgaqvtnzwprssqlhr ffdvzkisntobejkanznqe-tfl-c-------------------------------------------------y-c--tno-----w-------d--------------ajqhhplmgxmfgywrnkpb eqiraeoxddjowolpjtlhm-jabp-du---------------------------------------------------ef-------------l--------x-r-----ndpuxqxkcnyowzwsrmks gadgfdbchusybczzhtlkrbowih-g-wi------------------------------------------i--------n---------g----l-------g-t----vmbtxeoktlmgquuvhmnh clpumycobgydpyqnzvijsvemsq-lacm------------------------------------------------n---r----q--------------n---r----garsyicttuvhzhvylnbm vtltcdqhzwomhcoxmjczjc-drvobxoc------------------------------------------i--------------t----t-------------o----fneeurfjleugaruytfwy
  • 66.
    • tompng's comment “Besttool to view png” tompng5.rb
  • 67.
    Winner » eban etomame shinh yhara leonid matz AVG. “Best Spiral” 『最高の螺旋で賞』 Yusuke Endoh (JP) 6 10 N/A 10 9 9 6 8.33
  • 68.
    “Best spiral” mame2.rb '';eval(r=%q(->z{r="'';eval(r=¥ %q(#{r}))[%q`#{z}`]";i=-040;30. times{|n|(15+n%2*15-n/2).times{ r<<r[i+=(1.-n&2)*(32-n%2*31)]}} i=r[524,0]=?¥0;eval(r[479..-1]) c['"']}))[%q`GFEDCBA"+"[e¥"'"'t kE*;;¥";" TRICK2018";tb,;{{r 2E0$ob[us@*0)[90,336])_#i¥n}s#i 0H}>["t]];};o[1,?¥n*8];ex"-}eac 1Hl<1[-1]*2*t=n%2];o[14-n,0)mvk 8M$<4,?¥n];15.times{|n|;o[35ie2 !Pss.slice!(0,1)+x;sleep(0.0t;0 'W=%q"<<95<<$s<<95;o=->n,x{n.'1 ;@[2]}|¥e../,%@s="'%trick2018!8 eval$s=%q_eval($s.gsub!(/#{%@`]
  • 69.
  • 70.
    • A Quinethat prints itself in spiral manner – Uses an escape sequence to move the cursor • The output is rearranged, and contains many escape sequences, but it is actually executable • mame's comment “Best spiral” mame2.rb - Spoiler
  • 71.
    • The firstletter of each line spells out: “Best spiral” mame2.rb - Spoiler '';eval(r=%q(->z{r="'';eval(r=¥ %q(#{r}))[%q`#{z}`]";i=-040;30. times{|n|(15+n%2*15-n/2).times{ r<<r[i+=(1.-n&2)*(32-n%2*31)]}} i=r[524,0]=?¥0;eval(r[479..-1]) c['"']}))[%q`GFEDCBA"+"[e¥"'"'t kE*;;¥";" TRICK2018 ";tb,;{{r 2E0$ob[us@*0)[90,336])_#i¥n}s#i 0H}>["t]];};o[1,?¥n*8];ex"-}eac 1Hl<1[-1]*2*t=n%2];o[14-n,0)mvk 8M$<4,?¥n];15.times{|n|;o[35ie2 !Pss.slice!(0,1)+x;sleep(0.0t;0 'W=%q"<<95<<$s<<95;o=->n,x{n.'1 ;@[2]}|¥e../,%@s="'%trick2018!8 eval$s=%q_eval($s.gsub!(/#{%@`] '';eval(r=%q(->z{r="'';eval(r=¥ %q(#{r}))[%q`#{z}`]";i=-040;30. times{|n|(15+n%2*15-n/2).times{ r<<r[i+=(1.-n&2)*(32-n%2*31)]}} i=r[524,0]=?¥0;eval(r[479..-1]) c['"']}))[%q`GFEDCBA"+"[e¥"'"'t kE*;;¥";" TRICK2018 ";tb,;{{r 2E0$ob[us@*0)[90,336])_#i¥n}s#i 0H}>["t]];};o[1,?¥n*8];ex"-}eac 1Hl<1[-1]*2*t=n%2];o[14-n,0)mvk 8M$<4,?¥n];15.times{|n|;o[35ie2 !Pss.slice!(0,1)+x;sleep(0.0t;0 'W=%q"<<95<<$s<<95;o=->n,x{n.'1 ;@[2]}|¥e../,%@s="'%trick2018!8 eval$s=%q_eval($s.gsub!(/#{%@`]
  • 72.
    Winner » eban etomame shinh yhara leonid matz AVG. “Most reserved” 『最も予約されていたで賞』 kinaba (JP) 7 7 10 10 10 10 7 8.71
  • 73.
    • Before showingthe program… – kinaba2.rb is a program that does nothing “Most reserved” kinaba2.rb
  • 74.
    “Most reserved” FYI: Ruby'sreserved words Ruby Reference Manual: spec/flexical https://docs.ruby-lang.org/ja/latest/doc/spec=2flexical.html Here is the list of the reserved words Reserved words
  • 75.
    • A programthat consists only of reserved words of Ruby “Most reserved” kinaba2.rb alias BEGIN for unless def class super true or return defined? next break while begin undef do end rescue then retry else undef module nil ensure case if yield __LINE__ self and redo elsif not __FILE__ alias END in end when __ENCODING__ end until false end
  • 76.
    • A positionof the reserved words has a strong restriction – must be inside rescue – / / must be inside loop – if return then true end #=> SyntaxError (void value expression) • Further restriction of "six words pre one line" is imposed “Most reserved” kinaba2.rb - Spoiler retry rescue break next redo if return then true end #=> SyntaxError (void value expression)
  • 77.
    • / /can take reserved words • / can be used to avoid "void value expression" “Most reserved” kinaba2.rb - Spoiler def alias undef if return then true end #=> SyntaxError (void value expression) if false or return then true end #=> no error alias BEGIN XXX… or and
  • 78.
    • kinaba's lastcomment “Most reserved” kinaba2.rb - Spoiler
  • 79.
  • 80.
    Honorable mentions • Bestmonkey - Tomoya Ishida (tompng) • Best abuse of lambda - Shinichiro Hamaji • Best abuse of meta - Yuki Yugui Sonoda • Most solvable - Don Yang • Best layout - Yutaka HARA • Best abuse of regexp - Benoit Daloze (eregon) • Most tolerant - Shuichi Tamayose • Best applause - Colin Fulton – Enjoy them yourself at the github
  • 81.
    Winners & Judges’awards 6th & eban award: “Most reversible”–Yusuke Endoh 7th: “Best compiler”–Tomoya Ishida 8th & shinh & leonid awrad: “Most composable” – Colin Fulton 9th: “Most (un)readable” – Yutaka HARA 10th & matz award: “Best double meaning” – Tomoya Ishida 11th & eto award: “Most attractive” – Tomoya Ishida 12th & mame award: “Minimum alternative of irb” - Jan Lelis 13th & yhara award: “Most warned” – kinaba
  • 82.
    Dishonorable Top Five “Mostreserved” – kinaba “Best spiral” – Yusuke Endoh “Best png viewer” – Tomoya Ishida (tompng) “Best one-liner” – Colin Fulton “Most three-dimentional” – Tomoya Ishida 4th 5th
  • 83.
    Prize? • Dishonor: thetitle of “insane” • Invitation to RubyKaigi 2018 • Top five entries will be checked into the Ruby official repository in “sample” directory – Ruby 2.6.0 will have them (perhaps)
  • 84.
    General comments • Judges& winners, say your comments if any
  • 85.
    Conclusion • The winningentries will be published soon at: • Thank you for all participants! • See you in the next TRICK "Returns" ??? No k! http://github.com/tric /trick2018/