for i:=1 to 7 do if dom2[i].v then begin if xr=0 then begin vb:=@dom2[i]; setbrushcolor(rgb(255,0,0)); end else setbrushcolor(rgb(255,255,255)); xr:=xr-1; FillRoundRect(xl,480,xl+50,500,10,10); xl:=xl+60; end; if xr=0 then begin vb:=nil; setbrushcolor(rgb(255,0,0)); end else setbrushcolor(rgb(255,255,255)); FillRoundRect(xl,480,xl+50,500,10,10); redraw; sleep(20); until b; b:=false; if (x=y)or(vb=nil) then b:=true else begin if ((z1=100)and(z2=100))or(vb^.s1=z1)or(vb^.s2=z1)or(vb^.s1=z2)or(vb^.s2=z2) then begin b:=true; if (z1=100)and(z2=100) then begin stol[0]:=vb^; z1:=stol[0].s1; z2:=stol[0].s2; nl:=0; nr:=0; end else begin if vb^.s2=z1 then begin nl:=nl-1; stol[nl]:=vb^; z1:=vb^.s1; end else if vb^.s1=z1 then begin nl:=nl-1; stol[nl].s1:=vb^.s2; stol[nl].s2:=vb^.s1; stol[nl].v:=true; z1:=vb^.s2; end else if vb^.s1=z2 then begin nr:=nr+1; stol[nr]:=vb^; z2:=vb^.s2; end else if vb^.s2=z2 then begin nr:=nr+1; stol[nr].s1:=vb^.s2; stol[nr].s2:=vb^.s1; stol[nr].v:=true; z2:=vb^.s1; end; end; vb^.v:=false; end else begin setfontcolor(clred); textout(150,150,'Не верно!'); redraw; sleep(500); end; end; until b; end
|
|
|