Skip to content

Instantly share code, notes, and snippets.

@tompng
Created December 28, 2021 23:37
Show Gist options
  • Save tompng/9fe89c1e810c4d33b3865c188bd1417a to your computer and use it in GitHub Desktop.
Save tompng/9fe89c1e810c4d33b3865c188bd1417a to your computer and use it in GitHub Desktop.
eval(c =%w@i=
1;c=('e val(c=%
w'+64.ch r+(c.spl
it(w=35.c hr)[0].su
b(/[0-9]/) {(_1.to_i+
1)%7}+w)*3) .chars;s=(4
...41).map{ |y|(2...43)
.map{|x|p=" 000080010c6
hd6j100c62d 62562g6hi6h
i6j4e209001 0g6h909i6j"
[(i<2?i:i-1 )*9+y/15*3+
x/15].to_i( 20);rx=x%15
+p%2*15-14. 5;ry=y%15+p
/2*15-134.5 ;a=(x%15-2)
/11;b=(y%15 -4)/7;[((x-
22).abs+y-24).abs<6,!
0,y>22&&(x-y+-2).ab
s<6][i]||p!=0&&((
121*rx**2+169*r
y**2-20449)*(
4*rx**2+ry*
*2-16)<=0||
p<16&&(a*b=
=a+b||a*b==
0&&p[(3*b+a
+3)/2]==1))
??!:32.chr}
.join.rstri
p}.join$/;s
[-5..]=64.c
hr+"*'')";p
uts(s.gsub(
?!){c.shift
})&.ypresto
(2021/12/30
)&.age+=1;#
i=1;c=@*'')
data = [
nil, nil, nil,
nil, 'D', nil,
nil, 'U', nil,
'DR', 'LR', 2,
'UDR', 'LR', 4,
'U', nil, nil,
'DR', 'LR', 'L',
'UDR', 'LR', 'L',
'UR', 'LR', 'L',
1, 'LR', 2,
3, 'LR', 2,
3, 'LR', 4,
'R', 'LRD', 'L',
nil, 'UD', nil,
nil, 'U', nil,
1, 'LR', 2,
'UD', nil, 'UD',
3, 'LR', 4,
]
def convert(c)
return 0 unless c
return [0,16,17,18,19][c] if c.is_a? Integer
'ULRD'.chars.each_with_index.sum { c[_1] ? 1 << _2 : 0 }
end
data = data.map{convert _1}
D=data.map{_1.to_s(36)}.join
S=15
WN = 2
HN = 4
GCD = WN.gcd HN
code = File.read(__FILE__).split(/^#CODE/).last
code.gsub!(/[A-Z]+/){Object.const_get(_1).inspect}
while true
replaced = false
code.gsub!(%r{\([\d+*/\-.]+\)}){
next _1 if _1 =~ /\.\./ || _1 =~ /\(\d+\)/ || _1 =~ /2021/
replaced = true
eval(_1).inspect
}
break unless replaced
end
code.gsub!(/([+(-])1\*/){_1[0]}
code=code.delete "\n "
c=code;eval code
exit
#CODE
i=0;
c=('eval(c=%w'+64.chr+(c.split(w=35.chr)[0].sub(/[0-9]/){(_1.to_i+1)%7}+w)*3).chars;
s=(HN...(3*S-HN)).map{|y|
(WN...(3*S-WN)).map{|x|
p=D[(i<2 ? i : i-1)*9+y/S*3+x/S].to_i(20);
rx=x%S+p%2*S-(S-0.5);
ry=y%S+p/2*S-(9*S-0.5);
a=(x%S-WN)/(S-2*WN);
b=(y%S-HN)/(S-2*HN);
[((x-(S*3/2)).abs+y-(S*3/2+HN/2)).abs<((S-2*HN)*9/10),!0,y>(S*3/2)&&(x-y+(WN-HN)).abs<((S-2*HN)*9/10)][i]||
p!=0&&(
(((S-HN)**2)*rx**2+((S-WN)**2)*ry**2-(((S-WN)*(S-HN))**2))*(((HN/GCD)**2)*rx**2+((WN/GCD)**2)*ry**2-((WN*HN/GCD)**2))<=0 ||
p<16&&(a*b==a+b||a*b==0&&p[(3*b+a+3)/2]==1))? ?! : 32.chr
}.join.rstrip
}.join$/;
s[-5..]=64.chr+"*'')";
puts(s.gsub(?!){c.shift})&.ypresto(2021/12/30)&.age+=1;
@ypresto
Copy link

ypresto commented Dec 29, 2021

#!/bin/bash

code="$(cat y.rb)"

while true; do
  clear
  echo "$code"
  code="$(echo "$code" | ruby)"
  for i in `seq 1 3000`; do
    echo > /dev/null
  done
  echo
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment