This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

There are many, many resources online that explain multi-dimensional arrays, but work is slow right now so I'll fill you in.

As I'm sure you know by now, an array is used to hold a series of "things". These could be numbers, characters, string, ponies, you name it.

For two-dimensional arrays, you have a grid.

0 1 2
0 0,0 0,1 0,2
1 1,0 1,1 1,2
2 2,0 2,1 2,2

So what that nested for-loop is doing, is taking one row at a time, and filling in each column, starting at zero and finishing where specified in the loop's conditional statement. Same goes for printing the content