{} FUNCTION ANALIZ:BYTE; const mol = 1000; d1 = 47.6; d2 = 52.4; Var i, j : integer; x, y, a, b, temp1, temp2, t_pr, kol1, kol2 : single; BEGIN t_pr :=t; if p.KOL_HOD < 979 then begin for I := 1 to mol do begin //проверка по игреку (accepted!) if ((p.M[i].Y + (p.M[i].DY)) > 0) and ((p.M[i].y+(p.M[i].DY)) < 100) then begin m[i, 2] := p.M[i].Y + (p.M[i].DY); End else begin if (p.M[i].Y + (p.M[i].DY)) < 0 then m[i, 2]:= -(p.M[i].Y + (p.M[i].DY)); if (p.M[i].Y + (p.M[i].DY)) > 100 then m[i, 2]:= 100 -((p.M[i].Y + (p.M[i].DY)) - 100); end; End; for I := 1 to mol do begin // проверка на стенки по икс (без центральной стены, accepted!) if ((p.M[i].X + (p.M[i].DX)) > 0) and ((p.M[i].x+(p.M[i].Dx)) < 200) then begin m[i, 1] := p.M[i].X + (p.M[i].DX); end else begin if (p.M[i].X + (p.M[i].DX)) < 0 then m[i, 1]:= -(p.M[i].X + (p.M[i].DX)); if (p.M[i].X + (p.M[i].DX)) > 200 then m[i, 1]:= 200 -((p.M[i].X + (p.M[i].DX)) - 200); end; End; //---------------здесь замутим проверку на стенку в центре------------------- for I := 1 to mol do begin if ((p.M[i].X) < 100) and ((p.M[i].X + (p.M[i].DX)) > 100) then begin if (p.M[i].Y > d2) and ((p.M[i].Y + (p.M[i].DY)) > d2) then m[i,1] := 100 - ((p.M[i].X + (p.M[i].DX))-100); if (p.M[i].Y < d1) and ((p.M[i].Y + (p.M[i].DY)) < d2) then m[i,1] := 100 - ((p.M[i].X + (p.M[i].DX))-100); // проверка на дырку if (p.M[i].Y > d2) and ((p.M[i].Y + (p.M[i].DY)) < d2) then begin a := (100 - p.M[i].X); x := (p.M[i].DX) / a; y := p.M[i].DY / x; y := p.M[i].Y + y; if (y < d1) or (y > d2) then m[i,1] := 100 - ((p.M[i].X + (p.M[i].DX))-100); end; if (p.M[i].Y < d1) and ((p.M[i].Y + (p.M[i].DY)) > d1) then begin a := (100 - p.M[i].X); x := (p.M[i].DX) / a; y := p.M[i].DY / x; y := p.M[i].Y + y; if (y < d1) or (y > d2) then m[i,1] := 100 - ((p.M[i].X + (p.M[i].DX))-100); end; End; if ((p.M[i].X) > 100) and ((p.M[i].X + (p.M[i].DX)) < 100) then begin if (p.M[i].Y > d2) and ((p.M[i].Y + (p.M[i].DY)) > d2) then m[i,1] := 100 + (100 - (p.M[i].X + (p.M[i].DX))); if (p.M[i].Y < d1) and ((p.M[i].Y + (p.M[i].DY)) < d1) then m[i,1] := 100 + (100 - (p.M[i].X + (p.M[i].DX))); // проверка на дырку if (p.M[i].Y > d2) and ((p.M[i].Y + (p.M[i].DY)) < d2) then begin a := p.M[i].X - 100; x := -(p.M[i].DX) / a; y := p.M[i].DY / x; y := p.M[i].Y + y; if (y < d1) or (y > d2) then m[i,1] := 100 + (100 - (p.M[i].X + (p.M[i].DX))); end; if (p.M[i].Y < d1) and ((p.M[i].Y + (p.M[i].DY)) > d1) then begin a := p.M[i].X - 100; x := -(p.M[i].DX) / a; y := p.M[i].DY / x; y := p.M[i].Y + y; if (y < d1) or (y > d2) then m[i,1] := 100 + (100 - (p.M[i].X + (p.M[i].DX))); end; End; END;// cycle for I := 1 to 1000 do begin if p.M[i].DX < 0 then a:= - p.M[i].DX else a:= p.M[i].DX; if p.M[i].DY < 0 then b:= - p.M[i].DY else b:= p.M[i].DY; if m[i,1] < 100 then temp1:= temp1 + a + b else temp2 := temp2+a+b; t := temp2-temp1; End; If t > t_pr then ANALIZ:=1 else Analiz:=0; if p.KOL_HOD < 10 then analiz := 0; {kol1 := 0; kol2 := 0; for I := 1 to 1000 do begin if m[i,1] < 100 then kol1 := kol1+1 else kol2 := kol2 +1; End; if kol1 > kol2 then analiz := 1 else analiz := 0; } end; END; { Конец подпрограммы пользователя} {}