Golfing Advent of Code 2020, Day 3 I thought it'd be interesting to turn AoC day 3 puzzle into a Golfing Challenge, so here it is.
Task
Find the number of # you'd encounter in an 11x11 grid (consisting of # and .) that repeats itself (to the right side), starting at the top left corner, which is always a .. You will need to check the position that is \$x\$ right, \$y\$ down, then the position that is \$x\$ right, \$y\$ down from there and so on until you reach one of the bottom # or ..
Input
Two arguments:

3,1


..##.......
#...#...#..
.#....#..#.
..#.#...#.#
.#...##..#.
..#.##.....
.#.#.#....#
.#........#
#.##...#...
#...##....#
.#..#...#.#



means that you should traverse the grid going 3 right and 1 down. The output should be 7 (see the example in the AoC link above).
Without changing the grid but only the positions, here are some example inputs and outputs:

\$x=1, y=1 \to 2\$.
\$x=5, y=1 \to 3\$.
\$x=7, y=1 \to 4\$.
\$x=1, y=2 \to 2\$.



1,1


.........##
.#.#.......
#.......#..
.........#.
.....#.....
...##...#..
#.#..#....#
........##.
......#....
...####...#
.........#.



means traversing the grid going 1 right, 1 down each time. You'd encounter only 1 # in this example, so the output should be 1.
Rules

\$x\$ (right) and \$y\$ (down) will be positive integers, where \$y &lt; 3\$ (no limits for \$x\$).
The grid can be repeated unlimited times.
You can replace . and # with whatever you like in the grid (e.g. 0/1). Just mention which corresponds to which.
You can receive input through any of the standard IO methods.
This is code-golf, so shortest code in bytes wins!
J, 30 26 23 22 bytes
0{0{[:+/|.^:(&lt;@%&amp;{.~$)

Try it online!
Note: This solution works for any grid
J supports multi-dimensional rotation, which reduces the problem almost to a single summation.  To clarify what's happening, assume the board looks like this:
 0  1  2  3  4
 5  6  7  8  9
10 11 12 13 14
15 16 17 18 19
20 21 22 23 24
25 26 27 28 29
30 31 32 33 34
35 36 37 38 39

Now we rotate the columns left and the rows up |. by 1 3, iteratively, 3 times:
┌──────────────┬──────────────┬──────────────┐
│ 0  1  2  3  4│ 8  9  5  6  7│11 12 13 14 10│
│ 5  6  7  8  9│13 14 10 11 12│16 17 18 19 15│
│10 11 12 13 14│18 19 15 16 17│21 22 23 24 20│
│15 16 17 18 19│23 24 20 21 22│26 27 28 29 25│
│20 21 22 23 24│28 29 25 26 27│31 32 33 34 30│
│25 26 27 28 29│33 34 30 31 32│36 37 38 39 35│
│30 31 32 33 34│38 39 35 36 37│ 1  2  3  4  0│
│35 36 37 38 39│ 3  4  0  1  2│ 6  7  8  9  5│
└──────────────┴──────────────┴──────────────┘

We are bringing the sled's &quot;new position&quot; to the top-left corner every time, rather than moving a pointer within a fixed grid and adjusting indexes with modular arithmetic.
Once we have every iteration like this, we need only &quot;sum the planes&quot; element-wise [:+/, and then our answer will the number in the top left corner of the resulting matrix 0{0{.
The only piece left is to determine how many times we need to iterate.  This amounts to dividing the first element of our &quot;step&quot; vector (the down part) into the height of the input matrix: %&amp;{.~$.
old approach, 26 bytes
1#.]{~[:;/$@]|&quot;1#\@]*($~#)

Try it online!