помогите, пожалуйста, очень нужно. Я сделала программу, но не могу в ней сделать так чтобы когда все фигуры или две фигуры находятся в правом поле можно было бы взять и перенести любую а не последнюю передвинутую.
uses CRT,graphABC;
var a,b,x,y: integer;
c:char;
label n1,n2,n3,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,loop1,loop2,loop3,loop4,loop5,loop6,loop
7,loop8,loop9,loop10,loop11,loop12,loop13;
procedure treygolnik;
begin
line(x,y,x+50,y+100);
line(x+50,y+100,x-50,y+100);
line(x-50,y+100,x,y);
end;
procedure kryg;
begin
circle(x,y+200,50);
end;
procedure kvadrat;
begin
rectangle(x-50,y+300,x+50,y+400);
end;
begin
x:=100;
y:=50;
setwindowsize(1000,600);
line(200,0,200,500);
line(800,0,800,500);
line(0,500,1000,500);
line(200,310,400,310);
treygolnik;
kryg;
kvadrat;
m1:
n1:
textout(10, 510, 'Âûáèðèòå ôèãóðó è íàæìèòå êëàâèøó ñîîòâåòñòâóþùóþ âûáðàííîé âàìè ôèãóðû ');
textout(10, 530, 'Íàæìèòå `1` ÷òîáû âûáðàòü òðåóãîëüíèê ');
textout(10, 550, 'Íàæìèòå `2` ÷òîáû âûáðàòü êðóã');
textout(10, 570, 'Íàæìèòå `3` ÷òîáû âûáðàòü êâàäðàò');
loop1:
c:=readkey;
if not (c in [#49,#50,#51]) then goto loop1;
//òðåóãîëüíèê
if c = #49 then begin
m3:
setpencolor(clwhite);
treygolnik;
setpencolor(clblack);
line(200,310,400,310);
x:=x+200;
y:=y+150;
treygolnik;
textout(410, 510, '×òîáû ïåðåäâèíóòü ôèãóðó íàæìèòå "ïðîáåë" ');
textout(10, 510, 'Åñëè âû ïåðåäóìàëè ïîâòîðíî íàæìèòå: ');
textout(10, 530, '`1`åñëè âû âûáèðàëè òðåóãîëüíèê');
textout(10, 550, '`2` åñëè âû âûáèðàëè êðóã');
textout(10, 570, '`3` åñëè âû âûáèðàëè êâàäðàò');
loop2:
c:=readkey;
if not (c in [#49,#32]) then goto loop2;
if c = #49 then begin
setpencolor(clwhite);
treygolnik;
x:=100;
y:=50;
setpencolor(clblack);
treygolnik;
textout(230, 150, ' ');
goto m1;
end;
if c = #32 then begin
m2:
setbrushcolor(clwhite);
setpencolor(clwhite);
x:=201;
y:=200;
rectangle(x,y,x+200,y+111);
setpencolor(clblack);
line(600,310,800,310);
setpencolor(clblack);
x:=x+500;
treygolnik;
textout(410, 510, ' ');
textout(10, 510, '×òîáû ïåðåìåñòèòü òðåóãîëüíèê â ïðàâîå ïîëå íàæìèòå "1" ');
textout(10, 530, 'Åñëè âû ïåðåäóìàëè íàæìèòå "ïðîáåë" ');
textout(10, 550, ' ');
textout(10, 570, ' ');
loop3:
c:=readkey;
if not (c in [#32,#49]) then goto loop3;
if c = #32 then begin
setpencolor(clwhite);
line(600,310,800,310);
treygolnik;
x:=100;
y:=50;
goto m3;
end;
if c = #49 then begin
m9:
setpencolor(clwhite);
treygolnik;
setpencolor(clblack);
x:=900;
y:=50;
treygolnik;
textout(410, 510, ' ');
textout(10, 510, 'Åñëè âû ïåðåäóìàëè íàæìèòå "1" ');
textout(10, 530, 'Äëÿ ïåðåìåùåíèÿ ïîëî÷êè íàæìèòå "4" ');
textout(10, 550, ' ');
textout(10, 570, ' ');
loop4:
c:=readkey;
if not (c in [#49,#52]) then goto loop4;
if c = #49 then begin
setpencolor(clwhite);
treygolnik;
goto m2;
end;
if c = #52 then begin
setpencolor(clwhite);
line(600,310,800,310);
setpencolor(clblack);
line(200,310,400,310);
textout(410, 510, ' ');
textout(10, 510, 'Åñëè âû ïåðåäóìàëè íàæìèòå "4" ');
textout(10, 530, '×òîáû âçÿòü åùå îäíó ôèãóðó íàæìèòå "5" ');
textout(10, 550, ' ');
textout(10, 570, ' ');
loop5:
c:=readkey;
if not (c in [#52,#53]) then goto loop5;
if c = #53 then begin
x:=100;
y:=50;
setpencolor(clwhite);
treygolnik;
goto n1;
end;
if c = #52 then begin
setpencolor(clwhite);
line(200,310,400,310);
setpencolor(clblack);
line(600,310,800,310);
goto m9;
end;
end;
end;
end;
end;
//êðóã
if c = #50 then begin
m4:
setpencolor(clwhite);
kryg;
setpencolor(clblack);
line(200,310,400,310);
x:=x+200;
kryg;
textout(410, 510, '×òîáû ïåðåäâèíóòü ôèãóðó íàæìèòå "ïðîáåë" ');
textout(10, 510, 'Åñëè âû ïåðåäóìàëè ïîâòîðíî íàæìèòå: ');
textout(10, 530, 'Íàæìèòå `1`åñëè âû âûáèðàëè òðåóãîëüíèê');
textout(10, 550, 'Íàæìèòå `2` åñëè âû âûáèðàëè êðóã');
textout(10, 570, 'Íàæìèòå `3` åñëè âû âûáèðàëè êâàäðàò');
loop6:
c:=readkey;
if not (c in [#50,#32]) then goto loop6;
if c = #50 then begin
setpencolor(clwhite);
kryg;
x:=100;
y:=50;
setpencolor(clblack);
kryg;
textout(230, 150, ' ');
goto m1;
end;
if c = #32 then begin
m5:
setbrushcolor(clwhite);
setpencolor(clwhite);
x:=201;
y:=200;
rectangle(x,y,x+200,y+111);
setpencolor(clblack);
line(600,310,800,310);
setpencolor(clblack);
x:=x+500;
y:=50;
kryg;
textout(410, 510, ' ');
textout(10, 510, '×òîáû ïåðåìåñòèòü ôèãóðó â ïðàâîå ïîëå íàæìèòå "2" ');
textout(10, 530, 'Åñëè âû ïåðåäóìàëè íàæìèòå "ïðîáåë" ');
textout(10, 550, ' ');
textout(10, 570, ' ');
loop7:
c:=readkey;
if not (c in [#32,#50]) then goto loop7;
if c = #32 then begin
setpencolor(clwhite);
line(600,310,800,310);
kryg;
x:=100;
y:=50;
goto m4;
end;
if c = #50 then begin
m8:
setpencolor(clwhite);
kryg;
setpencolor(clblack);
x:=900;
y:=50;
kryg;
textout(410, 510, ' ');
textout(10, 510, 'Åñëè âû ïåðåäóìàëè íàæìèòå "2" ');
textout(10, 530, 'Äëÿ ïåðåìåùåíèÿ ïîëî÷êè íàæìèòå "4" ');
textout(10, 550, ' ');
textout(10, 570, ' ');
loop8:
c:=readkey;
if not (c in [#50,#52]) then goto loop8;
if c = #50 then begin
setpencolor(clwhite);
kryg;
goto m5;
end;
if c = #52 then begin
setpencolor(clwhite);
line(600,310,800,310);
setpencolor(clblack);
line(200,310,400,310);
textout(410, 510, ' ');
textout(10, 510, 'Åñëè âû ïåðåäóìàëè íàæìèòå "4" ');
textout(10, 530, '×òîáû âçÿòü åùå îäíó ôèãóðó íàæìèòå "5" ');
textout(10, 550, ' ');
textout(10, 570, ' ');
loop9:
c:=readkey;
if not (c in [#52,#53]) then goto loop9;
if c = #53 then begin
x:=100;
y:=50;
setpencolor(clwhite);
kryg;
goto n1;
end;
if c = #52 then begin
setpencolor(clwhite);
line(200,310,400,310);
setpencolor(clblack);
line(600,310,800,310);
goto m8;
end;
end;
end;
end;
end;
//êâàäðàò
if c = #51 then begin
m6:
setpencolor(clwhite);
kvadrat;
setpencolor(clblack);
line(200,310,400,310);
x:=x+200;
y:=y-150;
kvadrat;
textout(410, 510, '×òîáû ïåðåäâèíóòü ôèãóðó íàæìèòå "ïðîáåë" ');
textout(10, 510, 'Åñëè âû ïåðåäóìàëè ïîâòîðíî íàæìèòå: ');
textout(10, 530, 'Íàæìèòå `1`åñëè âû âûáèðàëè òðåóãîëüíèê');
textout(10, 550, 'Íàæìèòå `2` åñëè âû âûáèðàëè êðóã');
textout(10, 570, 'Íàæìèòå `3` åñëè âû âûáèðàëè êâàäðàò');
loop10:
c:=readkey;
if not (c in [#51,#32]) then goto loop10;
if c = #51 then begin
setpencolor(clwhite);
kvadrat;
x:=100;
y:=50;
setpencolor(clblack);
kvadrat;
textout(230, 150, ' ');
goto m1;
end;
if c = #32 then begin
m7:
setbrushcolor(clwhite);
setpencolor(clwhite);
x:=201;
y:=200;
rectangle(x,y,x+200,y+111);
setpencolor(clblack);
line(600,310,800,310);
setpencolor(clblack);
x:=x+500;
y:=-100;
kvadrat;
textout(410, 510, ' ');
textout(10, 510, '×òîáû ïåðåìåñòèòü ôèãóðó â ïðàâîå ïîëå íàæìèòå "3" ');
textout(10, 530, 'Åñëè âû ïåðåäóìàëè íàæìèòå "ïðîáåë" ');
textout(10, 550, ' ');
textout(10, 570, ' ');
loop11:
c:=readkey;
if not (c in [#32,#51]) then goto loop11;
if c = #32 then begin
setpencolor(clwhite);
line(600,310,800,310);
kvadrat;
x:=100;
y:=50;
goto m6;
end;
if c = #51 then begin
m10:
setpencolor(clwhite);
kvadrat;
setpencolor(clblack);
x:=900;
y:=50;
kvadrat;
textout(410, 510, ' ');
textout(10, 510, 'Åñëè âû ïåðåäóìàëè íàæìèòå "3" ');
textout(10, 530, 'Äëÿ ïåðåìåùåíèÿ ïîëî÷êè íàæìèòå "4" ');
textout(10, 550, ' ');
textout(10, 570, ' ');
loop12:
c:=readkey;
if not (c in [#51,#52]) then goto loop12;
if c = #51 then begin
setpencolor(clwhite);
kvadrat;
goto m7;
end;
if c = #52 then begin
setpencolor(clwhite);
line(600,310,800,310);
setpencolor(clblack);
line(200,310,400,310);
textout(410, 510, ' ');
textout(10, 510, 'Åñëè âû ïåðåäóìàëè íàæìèòå "4" ');
textout(10, 530, '×òîáû âçÿòü åùå îäíó ôèãóðó íàæìèòå "5" ');
textout(10, 550, ' ');
textout(10, 570, ' ');
loop13:
c:=readkey;
if not (c in [#52,#53]) then goto loop13;
if c = #53 then begin
x:=100;
y:=50;
setpencolor(clwhite);
kvadrat;
goto n1;
end;
if c = #52 then begin
setpencolor(clwhite);
line(200,310,400,310);
setpencolor(clblack);
line(600,310,800,310);
goto m10;
end;
end;
end;
end;
end;
hideCursor;
end.