Name/count nested elements.

19 Views Asked by At

Lets say I have a 2D grid:

\begin{array}{} \dots & C & \dots\\ C & B_2 & C\\ B_1 & A & B_3\\ \dots & B_4 & \dots \end{array}

The $B$'s are neighbours of $A$. And every $B$ has neighbours $C$. Now I want to say that I want to perform an action on every $C$ for every $B$. This last sentence is somehow inaccurate since the $C$'s are not equal and change their positions. I came up with something like:

For every $C_{B_{m}n}$, I do $X$ so that $B_m$ will be $Y$,

$m = {1,2,3,4}$,
$n = {1,2,3}$.

But this still sounds wrong. I just want to consider the three neighbours $C$ for every step. One step would be to go to the next $B$. I have trouble to come up with a notation/phrasing since I'm not used to it.