# [Ruby], 50 bytes

<!-- language-all: lang-ruby -->

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

[Try it online!][TIO-kjh6a2kc]

[Ruby]: https://www.ruby-lang.org/
[TIO-kjh6a2kc]: https://tio.run/##fZDRCsIwDEXf@xV7EZRF6MVHiT9S@uJwKDiQMXFD/PbaMcqSukmgLbm9OUna53kINYf9qaeBGmq54o7tuyu5ca1326rkfrcB/Ot6u1@KmCx58MfuEx5F7Q4EMs5ZsvEBsjJ8VFJK3aNgxW@kcxKmhHRAO7DmgIbPhQQrhytBl8HSHCuldLvGe2PG/WDeT4aLoXuUIZF6S2ngX00ryKrl7UNxkHmwyMECR7o0R7L@dB1XFb4 "Ruby – Try It Online"

Expects a matrix of 0s and 1s.