PROCEDURE faltkarte;

VAR
	t:INTEGER;
	r:INTEGER;
	y:INTEGER;
	s:REAL;
	b:REAL;

BEGIN
	
	penPat(2);
	penFore(0,0,65535);
	
	{*blatt zeichnen*}
	moveto(0,-20);
	lineto(297,-20);
	lineto(297,190);
	lineto(0,190);
	lineto(0,-20);

FOR t:=0 TO 4 DO BEGIN 

	penPat(2);
	penFore(0,0,65535);

	{*schneidekanten zeichnen*}

	r:=random*30;
	s:=random*4;
	b:=random*2;

	moveto(t*50+48,160);
	lineto(t*50+48,116-r); {*1*}
	lineto(t*50+43,116-r); {*2*}
	lineto(t*50+43,111-r); {*3*}
	lineto(t*50+52,108-r); {*4*}
	lineto((t*50+52)+(s-2),70-r);  {*5*}
	lineto(t*50+47,70-r);  {*6*}
	lineto((t*50+47)-b,45-r);  {*7*}

	moveto(t*50+35,45-r);
	lineto((t*50+35)+b,70-r);  {*8*}
	lineto(t*50+30,70-r);  {*9*}
	lineto((t*50+30)-(s-2),108-r); {*10*}
	lineto(t*50+39,111-r); {*11*}
	lineto(t*50+39,116-r); {*12*}
	lineto(t*50+33,116-r); {*13*}
	lineto(t*50+33,160);	 {*14*}

	{*faltkanten zeichnen*}

	penPat(-2);
	penFore(65535,0,0);

	moveto(t*50+35,45-r);
	lineto((t*50+47)-b,45-r); {*a*}

	moveto(t*50+33,160);
	lineto(t*50+48,160);  {*c*}

	moveto(t*50+33,133-r);
	lineto(t*50+48,133-r); {*b*}

IF (t=4) THEN BEGIN

	moveto(0,(45+r)+(160-116-r-17));
	lineto(20,(45+r)+(160-116-r-17));
	moveto(297,(45+r)+(160-116-r-17));
	lineto(270,(45+r)+(160-116-r-17));	
	
END;

END;

END;
RUN(faltkarte);