# [Whython](https://github.com/pxeger/whython), <sup><s>59</s></sup> 57 bytes <pre><code class="lang-python">f=lambda F,a,b,x=0:F[a-1][x%len(F[0])]+f(F[a:],a,b,x+b)?0</code></pre> [Attempt This Online!](https://ato.pxeger.com/run?1=ZVFLasMwEKVbncJIFCyiCLtZtDGIZOVLKFrINP6AqhjbIc5Zusmm9EzNaSp57Ma4ghnePN680Uif35fy2pUne7t9nbt8_fazzYXRH9m7DlKmWcZ6ESWp1OtYyf7ZHG2YykhRtcod0IkCzSqjuwgM7k_7YnJoEyl7ITDB-akJ-qCygVEeGg9b3tam6kxlj21IFaqbynah801EEWKMD4gTggh3QThyBGUxiyl9CNnLoo7ZZl4_jJwTh4M8GAMNwCc3wCfgCfBkxkM3GiTQM_YCHhXkz3-mmTzHBTaLC7_-XwgecvqRXw) Inputs a 2D array of booleans, and 2 integers. ## Normal Python, 69 bytes <pre><code class="lang-python">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)</code></pre> [Attempt This Online!](https://ato.pxeger.com/run?1=ZVHRasMgFKWvfoUog0itNM3DiuDoy_IT1gdDmy5gbWgySL9lL33Z_mn7mmpusoZWuHLu4ZyjV79-6kv7cfLX6_dnWy7Wv--lcvZY7CzOueUF79RS5touUmnetLF-h_vO6O7F7X2S66VhZl4GYKUBx7xgEPY32xzGtEZq3SlFKClPZ9zhymNnInQRNqKpXdW6yu-bhBlUnyvfJiFVqkNCCNkiQSmiIhQVKBCMpzxl7C7kq4c-5dm0vweFJAELRTAU6kHcwgFxA54CTyc8uFEvAc_gBTwo6H_-RDNmDgNkDxd-fR4IHnL8nRs)