Created
April 29, 2019 09:14
-
-
Save tompng/5cb316a8bb99871dcc903cdf7a7e2114 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
y=201904;eval(c=(%w(c=("y=#{y^1};eva | |
l(c=[7m([m[7m%[m[7mw[m[7m([m[7m#[m[7m{[m[7mc[m[7m}[m[7m)[m[7m*[m[7m'[m').gsub(/#{9[7m2[m.c[7mh[mr}x1B | |
.7?m/[7m,[m'')[7m)[m").[7mc[mhars;370.time[7ms[m{|i[7m|[mx=27 | |
.chr;$[7m>[m<<[7m([mi%[7m3[m7==36?$/[7m:[m[7m[[m[7mx[m[7m+[m[7m"[m[7m[[m[7m7[m[7mm[m[7m%[m[7ms[m[7m"[m[7m+[m[7mx[m+" | |
[m",'%s[7m'[m][7m[[m'[7mt[m97hors0ui[7m0[m6fp5k[7mk[m6ug8vdyd | |
ok[7ml[m[7mq[m[7md[m[7mk[m[7mj[m[7mb[m[7mg[m[7m8[m[7mm[m[7mt[m[7mp[m[7mh[m[7mn[m[7md[m[7mh[mtu3q[7m9[m[7mc[m[7m3[m[7m1[mwxn[7me[m49[7mw[mpe6m | |
rkconuqfj[7mo[m85ezlffy7zg[7ma[m7m[7m6[meagp[7mk[m[7my[mij5bf | |
cfg9yn1jb[7m8[mvyynfkv2y3n[7mo[mz9[7mj[mc4f1[7mt[m[7m3[mlk[7mf[m17 | |
ehg3nk0pa[7m7[m'.to_i(36)[7m[[m(y[7m&[m[7m1[m)*[7m3[m[7m7[m0+[7mi[m[7m][m]%[ | |
c.shift])})*'').gsub(/\x1B.7?m/,'')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pry' | |
texts = File.read('template.txt').split("\n\n") | |
shapes = texts.map { |t| t.split "\n" } | |
shapes.each do |s| | |
len = s.map(&:size).max | |
s.map! { |l| l + ' ' * (len - l.size) } | |
end | |
shapes.each do |shape| | |
shape.map! { |s| " #{s} ".gsub(/./) { |c| '# '[c.ord & 1] } } | |
l = '#' * shape[0].size | |
shape.push l | |
shape.unshift l | |
end | |
h = shapes[0].size | |
w = shapes[0][0].size | |
nums = shapes.map{|s|s.join(' ').gsub(/./){|a|a==' ' ? 0 : 1}.reverse.to_i(2)} | |
shifts = w * h + h | |
num = (nums[1] + (nums[0]<<shifts)).to_s(36) | |
code = DATA.read.gsub(/EMBED\{([^}]+)\}/) { eval $1 } | |
puts code | |
__END__ | |
y=201904;eval(c=(%w( | |
c=("y=#{y^1};eval(c=(%w(#{c})*'').gsub(/#{92.chr}x1B.7?m/,''))").chars; | |
EMBED{h*(w+1)}.times{|i|x=27.chr; | |
$><<(i%EMBED{w+1}==EMBED{w}?$/: | |
[x+"[7m%s"+x+"[m",'%s']['EMBED{num}'.to_i(36)[(y&1)*EMBED{shifts}+i]]%[c.shift]) | |
} | |
)*'').gsub(/\x1B.7?m/,'').delete(" \n")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
y=201905;eval(c=(%w(c=("y=#{y^1};eva | |
l(c=(%w(#[7m{[m[7mc[m})*'').gsub(/[7m#[m[7m{[m[7m9[m2.chr}x1B | |
.7?m/,''[7m)[m)"[7m)[m.chars;370[7m.[m[7mt[m[7mi[mmes{|i|x=27 | |
.chr;$>[7m<[m[7m<[m[7m([m[7mi[m[7m%[m[7m3[m7==36?$/:[x[7m+[m"[7m[7m%[m[7ms[m[7m"[m[7m+[m[7mx[m+" | |
[m",'[7m%[m[7ms[m']['t9[7m7[m[7mh[mors0ui[7m0[m[7m6[m[7mf[m[7mp[m[7m5[m[7mk[m[7mk[m6[7mu[mg8v[7md[myd | |
ok[7ml[m[7mq[m[7md[mk[7mj[m[7mb[m[7mg[m[7m8[m[7mm[m[7mt[m[7mp[mhn[7md[m[7mh[m[7mt[mu3q9c[7m3[m[7m1[m[7mw[mxne[7m4[m9wp[7me[m6m | |
rkconuqfj[7mo[m85[7me[mzlffy7zga[7m7[mm[7m6[me[7ma[m[7mg[mp[7mk[myij[7m5[mbf | |
cfg9yn1jb[7m8[mv[7my[m[7my[mnfkv2y3n[7mo[mz9[7mj[mc4f1[7mt[m[7m3[m[7ml[m[7mk[m[7mf[m17 | |
ehg3nk0pa[7m7[m'.to_i(36)[(y&[7m1[m)*370+i]]%[ | |
c.shift])})*'').gsub(/\x1B.7?m/,'')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########### # # | |
# # # # # | |
# # # ############# | |
# # # # # | |
############### #### # # | |
# # # ## | |
# # # ## # | |
# # ## ## ## | |
## ### | |
# # ### | |
###### # ##### | |
## ## ####### # # | |
### ####### ### ### # # | |
# # # # ## # # | |
# ## # # ##### | |
# # |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment