Your distance-idea is pretty good. Just use it.
Code:
const
min = -5;
max = 5;
var
map: array [min..max] of array [min..max] of byte;
x, y: integer;
maxz: byte = 0; // used to invert your circle;
begin
for x := min to max do
for y := min to max do
begin
map[x,y] := round(sqrt(x*x+y*y));
if map[x,y] > maxz then maxz := map[x,y];
end;
// print the map
for y := min to max do
begin
for x := min to max do write(maxz-map[x,y], ' ');
writeln;
end;
readln;
end.
Output:
0 1 1 2 2 2 2 2 1 1 0
1 1 2 3 3 3 3 3 2 1 1
1 2 3 3 4 4 4 3 3 2 1
2 3 3 4 5 5 5 4 3 3 2
2 3 4 5 6 6 6 5 4 3 2
2 3 4 5 6 7 6 5 4 3 2
2 3 4 5 6 6 6 5 4 3 2
2 3 3 4 5 5 5 4 3 3 2
1 2 3 3 4 4 4 3 3 2 1
1 1 2 3 3 3 3 3 2 1 1
0 1 1 2 2 2 2 2 1 1 0
Improvement:
You can also use the (float) distance as x for some fall-off function;
imagine the possibilites
Bookmarks