How about searching for some code on Google that does this kind of loop? Maybe "nested loops" or "looping over 2D array" might help. Even if it's code in C, C++, C# or some other language you might...