Skip to main content
added 59 characters in body
Source Link
vrintle
  • 3k
  • 12
  • 34

Ruby, 50 bytes

->x,y,m,r=c=t=0{t+=m[r][(c+=x)%11]while m[r+=y];t}

Try it online!

Expects a matrix of \$0\$s and \$1\$s. It is given that m[0][0] is never a tree, so I always skip it.

Ruby, 50 bytes

->x,y,m,r=c=t=0{t+=m[r][(c+=x)%11]while m[r+=y];t}

Try it online!

Expects a matrix of \$0\$s and \$1\$s.

Ruby, 50 bytes

->x,y,m,r=c=t=0{t+=m[r][(c+=x)%11]while m[r+=y];t}

Try it online!

Expects a matrix of \$0\$s and \$1\$s. It is given that m[0][0] is never a tree, so I always skip it.

added 8 characters in body
Source Link
vrintle
  • 3k
  • 12
  • 34

Ruby, 50 bytes

->x,y,m,r=c=t=0{t+=m[r][(c+=x)%11]while m[r+=y];t}

Try it online!

Expects a matrix of 0s\$0\$s and 1s\$1\$s.

Ruby, 50 bytes

->x,y,m,r=c=t=0{t+=m[r][(c+=x)%11]while m[r+=y];t}

Try it online!

Expects a matrix of 0s and 1s.

Ruby, 50 bytes

->x,y,m,r=c=t=0{t+=m[r][(c+=x)%11]while m[r+=y];t}

Try it online!

Expects a matrix of \$0\$s and \$1\$s.

Source Link
vrintle
  • 3k
  • 12
  • 34

Ruby, 50 bytes

->x,y,m,r=c=t=0{t+=m[r][(c+=x)%11]while m[r+=y];t}

Try it online!

Expects a matrix of 0s and 1s.