Skip to main content
added 17 characters in body
Source Link
pxeger
  • 24.6k
  • 4
  • 53
  • 141

Whython, 5959 57 bytes

f=lambda F,a,b,x=0,y=0:F[y][x%lenF[a-1][x%len(F[0])]+f(FF[a:],a,b,x+b,y+a)?0

Attempt This Online!Attempt This Online!

Inputs a 2D array of booleans, and 2 integers.

Normal Python, 69 bytes

f=lambda F,a,b,x=0:F[a-1:]>[]and F[a-1][x%len(F[0])]+f(F[a:],a,b,x+b)

Attempt This Online!

Whython, 59 bytes

f=lambda F,a,b,x=0,y=0:F[y][x%len(F[0])]+f(F,a,b,x+b,y+a)?0

Attempt This Online!

Inputs a 2D array of booleans, and 2 integers

Whython, 59 57 bytes

f=lambda F,a,b,x=0:F[a-1][x%len(F[0])]+f(F[a:],a,b,x+b)?0

Attempt This Online!

Inputs a 2D array of booleans, and 2 integers.

Normal Python, 69 bytes

f=lambda F,a,b,x=0:F[a-1:]>[]and F[a-1][x%len(F[0])]+f(F[a:],a,b,x+b)

Attempt This Online!

Source Link
pxeger
  • 24.6k
  • 4
  • 53
  • 141

Whython, 59 bytes

f=lambda F,a,b,x=0,y=0:F[y][x%len(F[0])]+f(F,a,b,x+b,y+a)?0

Attempt This Online!

Inputs a 2D array of booleans, and 2 integers