
Inc(Count);
Dec(i);
end;
//
if (j>=0)and(Map[i,j+1]<>-1)and((Map[i,j]-Map[i,j+1] = 1)) then
begin
x1:=41+(i)*h;
y1:=5+(j)*w;
x2:=h+39+(i)*h;
y2:=w+3+(j)*w;
rec:=Rect(x1,y1,x2,y2);
Form1.Image1.Canvas.Brush.Color:=($505045);
Form1.Image1.Canvas.FillRect(rec);
X:=40+Trunc(h/4)+i*h;
Y:=5+Trunc(w/4)+j*w;
Form1.Image1.Canvas.TextOut(X,Y,IntToStr(Count));
Inc(Count);
Inc(j);
end;
//
if (j>0)and(Map[i,j-1]<>-1)and(Map[i,j]-Map[i,j-1] = 1) then
begin
x1:=41+(i)*h;
y1:=5+(j)*w;
x2:=h+39+(i)*h;
y2:=w+3+(j)*w;
rec:=Rect(x1,y1,x2,y2);
Form1.Image1.Canvas.Brush.Color:=$505045;
Form1.Image1.Canvas.FillRect(rec);
X:=40+Trunc(h/4)+i*h;
Y:=5+Trunc(w/4)+j*w;
Form1.Image1.Canvas.TextOut(X,Y,IntToStr(Count));
Inc(Count);
Dec(j);
end;
//Inc(Count);
Dec(k);
end;
i:=0;
j:=0;
x1:=41+(i)*h;
y1:=5+(j)*w;
x2:=h+39+(i)*h;
y2:=w+3+(j)*w;
rec:=Rect(x1,y1,x2,y2);
Form1.Image1.Canvas.Brush.Color:=clRed;
Form1.Image1.Canvas.FillRect(rec);
{Bitmap.LoadFromFile('Черепашка.bmp');
BitMap.Height:=h-2;
BitMap.Width:=w-2;
Form1.Image1.Canvas.Draw(41,5,BitMap);}
end;
end;
end;
end.
Результат выполнения программы: