This algorthm walks a two-dimensional array (eg. a grid)  row by row.
//Grid
int height = 10;
int width = 10;
char[,] array = new char[width, height];
//Position
int y = 1; //y position
int x = 1; //x position
while (y <= height)
{
while (x <= width)
{
array[y - 1, x - 1] = item; //Assign
x++;
}
y++;
x = 1;
}
Latest comments