Skip to content

Instantly share code, notes, and snippets.

@tompng
Created January 26, 2020 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tompng/340815ead0f776245aca3d90f3aeda5e to your computer and use it in GitHub Desktop.
Save tompng/340815ead0f776245aca3d90f3aeda5e to your computer and use it in GitHub Desktop.
n=1;eval(x=%[$a='';def$a.+n;$a<<n.to_s;$a;end;->s{$a=s[0..1180];$x=$a.chars.map{
|a|(a.to_i-1).to_s}.join.to_i(9).digits(128).map(&:chr).join;eval($x)}]).call$a+
8327942+
6394+ 56937423834+
888599538188885813761+
1374578327473944888222+
397452662851954429537478+ 7314653+
722676446448949364443325+ 9386372913528+
9315395214419818269848526+ 3962341116632659+
2919887521749387373625886+ 69599931274556335+
626211923653651758925863+ 6793591582689591855517+
7155781238773773623412+ 78969868571911894224532242+
251877899494335539789+ 129418616891354376281694971+
1851647755718324398+7974356121455772975966616439+
176559284685+ 4711243849423178+2787895516222421569474431683+
56223465171478791756+ 719417484324832241418185362118849579261697+
27282367563923474755355725+277653683611334561856619749499114768425+
41587579336811525435366957982587784825684264982381591312149696633+
745495452542348153788867951645348121998444598787282746641586+
344557671838722214928331865437178285132554768372741+
134587717497976364696987521378672732362747833422365+
427714647741361177517218169922776146556333418667831933843459+
35934632874828369981279393335234241531799449694893862381388258291+
96561422751944428881224662+726829733479837551653324293193994449553+
43224434712781365275+ 434272637589117419279179811546882418262387+
665666438632+ 1313823474383679+6955272462778128273658612725+
3145111422686156972+9345742342148512318656366882+
971197496178327942639+ 456937423834888599538188885+
8137611374578327473944+ 88822239745266285195442953+
747873146537226764464489+ 4936444332593863729135+
2893153952144198182698485+ 26396234111663265+
9291988752174938737362588+ 6695999312745563+
356262119236536517589258+ 6367935915826+
895918555177155781238773+ 7736234+
1278969868571911894224+
532242251877899494335+
5397+ 89129418616+
8913543
prefix_code = <<CODE
n=0;eval(x=%!$a='';def$a.+n;$a<<n.to_s;$a;end;->s{$a=s[0..9999];$x=$a.chars.map{
|a|(a.to_i-1).to_s}.join.to_i(9).digits(128).map(&:chr).join;eval($x)}!).call$a+
CODE
code = File.read(__FILE__).split(/\n#CODE\n/).last.delete($/)
num=0;code.chars.reverse_each{|c|num=num*128+c.ord}
$a=num.to_s(9).chars.map{|a|a.to_i+1}.join
prefix_code.gsub!('9999', ($a.size-1).to_s)
x=prefix_code.scan(/%!(.+\n.+)!/)[0][0]
n=0
#CODE
puts'n=%d;eval(x=%%[%s]).call$a+'%[(n+1)%4,x];
$a=($a*2).chars;
include Math;
puts (0..39).map{|y|y=(y-19.5)*0.06;(0..79).map{|x|x=(x-39.5)*0.03;
r,t=(x+y.i).polar;
s,u=(x*0.93+0.45+y.i).polar;
[1.1*r<sin(2.5*t).abs**0.5+[sin(5*t).abs,0.7].min/4+0.1,
r<0.8||0.9<r&&1.1*r<1+sin(9*t)/6,
(1.2*u.abs<PI)?s<1.26*(1+cos(u)/4)*(cos(3*u).abs**0.5-sin(6*u).abs/4):-1.1<x&&y.abs<0.05,
(x+(y-0.5).i).abs<0.66||(x+(y+0.6).i).abs<0.5||(x.abs<0.8&&(y+x.abs-0.8).abs<0.05)][n]?($a.shift):' '
}.join.gsub(/\d /){|a|a[0]+?+}}.join($/).gsub(/\+(?=( |\n)*\z)/,' ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment