about summary refs log tree commit diff
path: root/day13.k
blob: ce394ea6ce8f5905d3b03872e13b9b4e64436b27 (plain) (blame)
1
2
3
4
5
6
7
8
9
d:1350

f:{(x*x) + (3*x) + (2*x*y) + y + (y*y)}

w:~2!(+/2\{+/(d;x*x;3*x;2*x*y;y;y*y)}.)''(!50),/:\:!50
m:w*{1 1~x}''(!50),/:\:!50

-1+|/|/{~x . 31 39}{w*(x+x>0)|(+-1_'0,'+x)|(+1_'(+x),'0)|(1_'x,'0)|(0,'-1_'x)}/m
+/+/0<50{w*(x+x>0)|(+-1_'0,'+x)|(+1_'(+x),'0)|(1_'x,'0)|(0,'-1_'x)}/m