>
begin
font.Size: = 1; p> rectangle (vx [i], vy [i], vx [i] +15, vy [i] +15); p> textout (vx [i] +4, vy [i] +1, inttostr (i)); p> end;
end;
with image2.Canvas do
begin
brush.color: = clLime;
pen.Color: = clblue;
font.Name: = 'Courier';
font.Size: = 8;
for i: = 1 to n do
for j: = 1 to n do
if (ar [i, j] <> 0) and (Ar [i, j] <900) then
begin
pen.Width: = 1;
moveto (vx [i] +7, vy [i] +7);
lineto (vx [j] +7, vy [j] +7);
brush.color: = clwhite;
textout (round ((vx [i] + vx [j] +4)/2), round ((vy [i] + vy [j] +1)/2), inttostr (ar [i, j ]));
end;
brush.color: = cllime;
for i: = 1 to n do
begin
font.Size: = 1; p> rectangle (vx [i], vy [i], vx [i] +15, vy [i] +15);
textout (vx [i] +4, vy [i] +1, inttostr (i)); p> end; end; end;
procedure TForm1.SpeedButton7Click (Sender: TObject);
var
i: integer;
begin
for i: = 1 to n do
begin
sg.ColCount: = n +1;
sg.Rowcount: = n +1;
sr.ColCount: = n +1;
sr.Rowcount: = n +1;
sg.Cells [0, i]: = inttostr (i); p> sr.Cells [0, i]: = inttostr (i); p> sg.Cells [i, 0]: = inttostr (i); p> sr.Cells [i, 0]: = inttostr (i); end;
for i: = 1 to n do
for j: = 1 to n do
begin
ar [i, j]: = 0;
end;
end;
procedure TForm1.Image2DblClick (Sender: TObject);
begin
timer1.Enabled: = true; p> end;
procedure TForm1.SpeedButton8Click (Sender: TObject);
begin
for i: = 1 to n do
begin
vx [i]: = random (470);
vy [i]: = random (230); p> end; end;
procedure TForm1.Image1MouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
vx [idown]: = x;
vy [idown]: = y;
idown: = idown +1;
image1.Canvas.brush.color: = cllime;
image1.Canvas.pen.Color: = clblue; p> image1.Canvas.Rectangle (x-1, y-1, x +1, y +1); p> end;
procedure TForm1.Image2Click (Sender: TObject);
begin
image1.Canvas.brush.color: = clwhite;
image1.Canvas.pen.Color: = clwhite; p> image2.Canvas.brush.color: = clwhite;
image2.Canvas.pen.Color: = clwhite; p> image1.Canvas.Rectangle (0,0, image1.Width, image1.Height); p> image2.Canvas.Rectangle (0,0, image1.Width, image1.Height); timer1.Enabled: = false;
end;
procedure TForm1.BitBtn1Click (Sender: TObject);
begin
n: = strtoint (edit1.text); p> speedbutton7.Click; p> end; p> procedure TForm1.BitBtn2Click (Sender: TObject);
var i: integer;
begin
if MessageDlg ('Завершити роботу', mtConfirmation, [mbyes, mbno], 0) = mrYes then begin