Modelling Environments -arrays
I cant move numbers from one square in a two dimensional array of 100 X100 to the 8 surrounding squares (gradients) evenly, then these numbers are then added to a graphic after some calcuations, to display them. Im using a time step to loop it all until it gets to the year you want. I can get one of the squares to work at one time but that just changes the numbers all together and not individually changing all of them. Heres some of the code to clear it up for you... possibly!!
'calculates the eight different directions sediment can move
For x = 2 To 99
For y = 2 To 99
gradient(1) = surface(x, y) - surface(x - 1, y - 1)
Next y
Next x
For x = 2 To 99
For y = 2 To 99
gradient(2) = surface(x, y) - surface(x - 1, y)
Next y
Next x
This repetition of code is made 8 times for the 8 different directions. Then i use the gradient to work out the next few problems
erosion = creep * gradient(1)
meanerosion = erosion / distance
elevation = meanerosion * time
For x = 2 To 99
For y = 2 To 99
surface(x, y) = surface(x, y) + elevation
Next y
Next x
Then the graphic is called up, please help and ill answer any questions regarding the program as best i can. Thank you for your time.

