Basically I'm creating a forest fire program that depends on the wind / dryness of the surround pieces. I have an array var Trees [,] that is 20 x 20. The middle square is set on "fire" what needs to be done once you click button1: Evaluate each square around the one that is set on fire to determine the probability for the others to catch fire.
Color[,] map = new Color[WIDTH, HEIGHT];
for (int x = 0; x < WIDTH; x++)
for (int y = 0; y < HEIGHT; y++)
{
if (x == WIDTH / 2 && y == HEIGHT / 2)
map[x, y] = Color.Red;
else
map[x, y] = Color.Green;
}
fireBox1.box = map;
This is the array that i have setup 20 x 20 with the middle square set on fire. I just have no idea how to get the squares around the one that is currently on fire.