Skip to main content
added 1 character in body
Source Link
l4m2
  • 28.5k
  • 2
  • 25
  • 103

JavaScript (Node.js), 88 8685 bytes

a=>g=(x,yy=0,c=0)=>a.map((p,i)=>pp=>p.map((q,j)=>c+=q-8?0:1/yx?(x-j)**2+y*y<3:g(j,i-y)<2,y)&--)y)|c

Try it online!Try it online!

Thank Arnauld for 2 bytes

JavaScript (Node.js), 88 86 bytes

a=>g=(x,y,c=0)=>a.map((p,i)=>p.map((q,j)=>c+=q-8?0:1/y?(x-j)**2+y*y<3:g(j,i)<2,y--))|c

Try it online!

Thank Arnauld for 2 bytes

JavaScript (Node.js), 88 85 bytes

a=>g=(x,y=0,c=0)=>a.map(p=>p.map((q,j)=>c+=q-8?0:1/x?(x-j)**2+y*y<3:g(j,-y)<2)&--y)|c

Try it online!

Thank Arnauld for 2 bytes

added 41 characters in body
Source Link
l4m2
  • 28.5k
  • 2
  • 25
  • 103

JavaScript (Node.js), 8888 86 bytes

f=a=>g=(a,x,y,c=0)=>a.map((p,i)=>p.map((q,j)=>c+=q-8?0:1/xy?(x-i)**2+(y-j)**2<3**2+y*y<3:fg(aj,i,j)<2,y--))|c

Try it online!Try it online!

Thank Arnauld for 2 bytes

JavaScript (Node.js), 88 bytes

f=(a,x,y,c=0)=>a.map((p,i)=>p.map((q,j)=>c+=q-8?0:1/x?(x-i)**2+(y-j)**2<3:f(a,i,j)<2))|c

Try it online!

JavaScript (Node.js), 88 86 bytes

a=>g=(x,y,c=0)=>a.map((p,i)=>p.map((q,j)=>c+=q-8?0:1/y?(x-j)**2+y*y<3:g(j,i)<2,y--))|c

Try it online!

Thank Arnauld for 2 bytes

Source Link
l4m2
  • 28.5k
  • 2
  • 25
  • 103

JavaScript (Node.js), 88 bytes

f=(a,x,y,c=0)=>a.map((p,i)=>p.map((q,j)=>c+=q-8?0:1/x?(x-i)**2+(y-j)**2<3:f(a,i,j)<2))|c

Try it online!