How do i change everything behind a certain point in a Jagged array?
- by Jack Null
Say I have a jagged array, and position 2,3 is taken by int 3. Every other spot is filled with int 0. How would I fill all the positions behind 2,3 with a 4?
0 0 0 0 0 0
0 0 0 0
0 0 0 3 0 0
0 0 0 0 0
to this:
4 4 4 4 4 4
4 4 4 4
4 4 4 3 0 0
0 0 0 0 0
Ive tried variations of this:
int a = 2;
int b = 3;
for (int x = 0; x < a; x++)
{
for (int y = 0; y < board.space[b].Length; y++)
{
board.space[x][y] = 4;
}
}