i just satisfy upto 4th iterations of your exmaple. The code is
int hbox = 6;
int vbox = 4;
for (int r = 1; r <= hbox; r++)
{
int x = 0;
for (int c = 1; c <= vbox; c++)
{
string val = arr[r - x, c];
x++;
list.Add(val);
if (r == c)
break;
}
}
But if 5th iteration i do not clear the varying part. There i saw row no is still same for iteration 4 and iteration 5. This requirement is little confused me. let me know the code will help you or not.