Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
smpr_lr1.docx
Скачиваний:
0
Добавлен:
01.05.2025
Размер:
117.91 Кб
Скачать

//Різниця

for i:=1 to 5 do

for j:=1 to 5 do

if i<>j then

begin

if form1.strngrd_ris.Cells[i-1,j-1]='1' then

begin

if i=1 then begin p1x:=67; p1y:=8; end;

if i=2 then begin p1x:=125; p1y:=49; end;

if i=3 then begin p1x:=104; p1y:=117; end;

if i=4 then begin p1x:=30; p1y:=117; end;

if i=5 then begin p1x:=10; p1y:=49; end;

if j=1 then begin p2x:=67; p2y:=8; end;

if j=2 then begin p2x:=125; p2y:=49; end;

if j=3 then begin p2x:=104; p2y:=117; end;

if j=4 then begin p2x:=30; p2y:=117; end;

if j=5 then begin p2x:=10; p2y:=49; end;

DrawArrow(Form1.Img_ris.Canvas,p1x,p1y,p2x,p2y,2);

end;

end

else

if form1.strngrd_ris.cells[i-1,j-1]='1' then

begin

if i=1 then begin p1x:=67; p1y:=4; end;

if i=2 then begin p1x:=129; p1y:=49; end;

if i=3 then begin p1x:=104; p1y:=121; end;

if i=4 then begin p1x:=30; p1y:=121; end;

if i=5 then begin p1x:=6; p1y:=49; end;

form1.Img_ris.Canvas.Ellipse(p1x+4,p1y+4,p1x-4,p1y-4);

end;

//Симетрична різниця

for i:=1 to 5 do

for j:=1 to 5 do

if i<>j then

begin

if form1.strngrd_sym.Cells[i-1,j-1]='1' then

begin

if i=1 then begin p1x:=67; p1y:=8; end;

if i=2 then begin p1x:=125; p1y:=49; end;

if i=3 then begin p1x:=104; p1y:=117; end;

if i=4 then begin p1x:=30; p1y:=117; end;

if i=5 then begin p1x:=10; p1y:=49; end;

if j=1 then begin p2x:=67; p2y:=8; end;

if j=2 then begin p2x:=125; p2y:=49; end;

if j=3 then begin p2x:=104; p2y:=117; end;

if j=4 then begin p2x:=30; p2y:=117; end;

if j=5 then begin p2x:=10; p2y:=49; end;

DrawArrow(Form1.Img_sym.Canvas,p1x,p1y,p2x,p2y,2);

end;

end

else

if form1.strngrd_sym.cells[i-1,j-1]='1' then

begin

if i=1 then begin p1x:=67; p1y:=4; end;

if i=2 then begin p1x:=129; p1y:=49; end;

if i=3 then begin p1x:=104; p1y:=121; end;

if i=4 then begin p1x:=30; p1y:=121; end;

if i=5 then begin p1x:=6; p1y:=49; end;

form1.Img_sym.Canvas.Ellipse(p1x+4,p1y+4,p1x-4,p1y-4);

end;

//Доповнення r1

for i:=1 to 5 do

for j:=1 to 5 do

if i<>j then

begin

if form1.strngrd_dopr1.Cells[i-1,j-1]='1' then

begin

if i=1 then begin p1x:=67; p1y:=8; end;

if i=2 then begin p1x:=125; p1y:=49; end;

if i=3 then begin p1x:=104; p1y:=117; end;

if i=4 then begin p1x:=30; p1y:=117; end;

if i=5 then begin p1x:=10; p1y:=49; end;

if j=1 then begin p2x:=67; p2y:=8; end;

if j=2 then begin p2x:=125; p2y:=49; end;

if j=3 then begin p2x:=104; p2y:=117; end;

if j=4 then begin p2x:=30; p2y:=117; end;

if j=5 then begin p2x:=10; p2y:=49; end;

DrawArrow(Form1.Img_dopr1.Canvas,p1x,p1y,p2x,p2y,2);

end;

end

else

if form1.strngrd_dopr1.cells[i-1,j-1]='1' then

begin

if i=1 then begin p1x:=67; p1y:=4; end;

if i=2 then begin p1x:=129; p1y:=49; end;

if i=3 then begin p1x:=104; p1y:=121; end;

if i=4 then begin p1x:=30; p1y:=121; end;

if i=5 then begin p1x:=6; p1y:=49; end;

form1.Img_dopr1.Canvas.Ellipse(p1x+4,p1y+4,p1x-4,p1y-4);

end;

//Доповнення r2

for i:=1 to 5 do

for j:=1 to 5 do

if i<>j then

begin

if form1.strngrd_dopr2.Cells[i-1,j-1]='1' then

begin

if i=1 then begin p1x:=67; p1y:=8; end;

if i=2 then begin p1x:=125; p1y:=49; end;

if i=3 then begin p1x:=104; p1y:=117; end;

if i=4 then begin p1x:=30; p1y:=117; end;

if i=5 then begin p1x:=10; p1y:=49; end;

if j=1 then begin p2x:=67; p2y:=8; end;

if j=2 then begin p2x:=125; p2y:=49; end;

if j=3 then begin p2x:=104; p2y:=117; end;

if j=4 then begin p2x:=30; p2y:=117; end;

if j=5 then begin p2x:=10; p2y:=49; end;

DrawArrow(Form1.Img_dopr2.Canvas,p1x,p1y,p2x,p2y,2);

end;

end

else

if form1.strngrd_dopr2.cells[i-1,j-1]='1' then

begin

if i=1 then begin p1x:=67; p1y:=4; end;

if i=2 then begin p1x:=129; p1y:=49; end;

if i=3 then begin p1x:=104; p1y:=121; end;

if i=4 then begin p1x:=30; p1y:=121; end;

if i=5 then begin p1x:=6; p1y:=49; end;

form1.Img_dopr2.Canvas.Ellipse(p1x+4,p1y+4,p1x-4,p1y-4);

end;

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]