PROCEDURE skript2;

VAR
i,j,h,a,b,y,u,z,u2 : INTEGER;
t,o2,o,d,v, w, s, l, p1X, p1Y, p2X, p2Y:REAL;

BEGIN

W := IntDialog('Leistung der Birne','75');
l := IntDialog('Durchmesser der Birne (cm)','5');
(*s := IntDialog('Dicke des Materials (cm)','1');*)

a:= (l/5+w/75)/2*20;
v:=a/1.4;
y:=Round(v);
d:= (a-y*s)/(y+1);
s:=0.2;
(*stützen*)

FOR j:=1 TO 4 DO BEGIN
		
	Line(0,a/6);
		FOR i:=1 TO y DO BEGIN
			Line(d,0);
			Line(0,-a/12);
			Line(s,0);
			Line(0,a/12);
		END;
	Line(d,0);
	Line(0,-a/6);
	Line(-y*(s+d)-d,0);
	Line(0,-a/6-2);
END;

line(0, -a);

(*platten*)

	FOR h:=1 TO y DO BEGIN
		
		line(a, 0);
		line(0, a);
		line(-a, 0);
		line(0, -a);
		line(a, 0);
		
	END;

(*löcher
o:=-(4*(a/6+2)+a);

Oval(p1X, p1Y, p2X, p2Y:REAL);*)

o:=-(4*(a/6+2)+a);
Oval(a/2-0.5, o+a/2-0.5, a/2+.5, o+a/2+.5);
Oval(3*(a/2)-2.1, o+a/2-2.1, 3*(a/2)+2.1, o+a/2+2.1);
Oval(5*(a/2)-2.1, o+a/2-2.1, 5*(a/2)+2.1, o+a/2+2.1);
Oval(7*(a/2)-2.1, o+a/2-2.1, 7*(a/2)+2.1, o+a/2+2.1);

o2:=4*a;
t:=((6+l/2)-4*(d+s))/(d+s);
z:=Round(t);

FOR u:=1 TO z+1 DO BEGIN
	Oval(o2+(u*2-1)*(a/2)-u*(l/4+l-4.1)/z-2.1, o+a/2-u*(l/4+l-4.1)/z-2.1, o2+(u*2-1)*(a/2)+u*(l/4+l-4.1)/z+2.1, o+a/2+u*(l/4+l-4.1)/z+2.1);
			
END;

FOR u2:= z+1 TO 1 DO BEGIN
	Oval(o2+(u*2-1)+o2+(u2*2-1)*(a/2)-u2*(l/2+l-4.1)/z-2.1, o+a/2-u2*(l/2+l-4.1)/z,o2+(u*2-1)+ o2+(u2*2-1)*(a/2)+u2*(l/2+l-4.1)/z+2.1, o+a/2+u2*(l/2+l-4.1)/z);
		
END;

(*FOR a:=0 TO b DO BEGIN
		
		FOR i:=0 TO 20 DO BEGIN
		fillback(random*50000,40000,50000);	
			pensize(2);
			oval(i,i*2,i+2,i*3);		
		END;

	rotatepoint(0,0,360/b);
	END;*)
END;

Run(skript2);