System: Windows XP, P4 2 GHz
Compiler/IDE: Delphi 7 for Win32
API: N/A
-----


Hi,

Been programming for a while during college and then got back into it recently. I'm a stuck trying to place a radial pattern in the centre of a array.

This is what I have so far
__
for l1:=1 to midpoint do

for l2:=1 to midpoint do
begin

cityd[midpoint+l1,midpoint-l2]:=(midpoint-l1);
cityd[midpoint-l1,midpoint+l2]:=(midpoint-l1);

cityd[midpoint+l1,midpoint+l2]:=(midpoint-l1);
cityd[midpoint-l1,midpoint-l2]:=(midpoint-l1);

cityd[midpoint+l1,midpoint]:=(midpoint-l1);
cityd[midpoint-l1,midpoint]:=(midpoint-l1);

cityd[midpoint,midpoint+l2]:=(midpoint-l1);
cityd[midpoint,midpoint-l2]:=(midpoint-l1);

end;

where cityd is a 2D array of dimensions 200,200
____
While this sort of works it give the highest values in the centre in a single column not a square of higher values expanding out to smaller values... I think the problem is how I am addressing the values in the code but I can't think of a way to address the values from the centre outwards that doesn't causes problems the further you move from the centre.

Model

1230321
1230321
1230321
1230321

Desired result

111111
122221
123321
122221
111111

The idea for this is to create levels for myself without adding thousands of buildings.... I know this is not as straght forward as I first thought after reading this post http://www.pascalgamedevelopment.com...pic.php?t=4936.
I'm not looking to creating fractual cities as Im not that good a programmer, but If I can figure this out it would go a long way.

Any help would be most appreciated!

Whitt