PROCEDURE doppeltreppe;

VAR
	x,y,z:REAL;
	a,c,e:INTEGER;

BEGIN

	x:=2;
	y:=3;
	z:=2;

	{*blatt zeichnen*}
	penFore(0,65535,0);
	penPat(2);
	moveto(0,0);
	lineto(210,0);
	lineto(210,297);
	lineto(0,297);
	lineto(0,0);

	{*faltkante*}
	penFore(65535,0,0);
	penPat(-2);
	moveto(0,148.5);
	lineto(90-(x+y+z-1)*10,148.5);
	moveto(120+(x+y+z-1)*10,148.5);
	lineto(210,148.5);

	{*treppe_1 schnitte*}
	penFore(0,65535,0);
	penPat(2);	
	
	FOR a:=0 TO x-1 DO BEGIN 
	penPat(2);
	penFore(0,65535,0);
	moveto(120+a*10,(58.5+30+x*10)-a*10);
	lineto(120+a*10,((58.5+30+x*10)-a*10)-40);
	END;
	
	FOR a:=0 TO x-1 DO BEGIN 
	penPat(2);
	penFore(0,65535,0);
	moveto(90-a*10,(58.5+30+x*10)-a*10);
	lineto(90-a*10,((58.5+30+x*10)-a*10)-40);
	END;

	{*treppe_1 ritzen*}
	penFore(65535,0,0);
	penPat(-2);
	moveto(90-(x-1)*10,58.5);
	lineto(120+(x-1)*10,58.5);
	moveto(90,58.5+x*10);
	lineto(120,58.5+x*10);
	moveto(90,58.5+30+x*10);
	lineto(120,58.5+30+x*10);

	FOR a:=0 TO x-1 DO BEGIN
	moveto(120+a*10,(58.5+30+x*10)-a*10);
	lineto(120+a*10-10,(58.5+30+x*10)-a*10);
	moveto(120+a*10,(58.5+x*10)-a*10);
	lineto(120+a*10-10,(58.5+x*10)-a*10);
	END;
	
	FOR a:=0 TO x-1 DO BEGIN
	moveto(90-a*10,(58.5+30+x*10)-a*10);
	lineto(90-a*10+10,(58.5+30+x*10)-a*10);
	moveto(90-a*10,(58.5+x*10)-a*10);
	lineto(90-a*10+10,(58.5+x*10)-a*10);
	END;

	{*treppe_2 schnitte*}
	penFore(0,65535,0);
	penPat(2);

	FOR c:=0 TO (x+y-1) DO BEGIN
	penPat(2);
	penFore(0,65535,0);
	moveto(120+c*10,(58.5+60+x*10+y*10)-c*10);
	lineto(120+c*10,((58.5+60+x*10+y*10)-c*10)-40);
	END;

	FOR c:=0 TO (x+y-1) DO BEGIN
	penPat(2);
	penFore(0,65535,0);
	moveto(90-c*10,(58.5+60+x*10+y*10)-c*10);
	lineto(90-c*10,((58.5+60+x*10+y*10)-c*10)-40);
	END;
	
	{*treppe_2 ritzen*}
	penFore(65535,0,0);
	penPat(-2);
	moveto(90,58.5+30+x*10+y*10);
	lineto(120,58.5+30+x*10+y*10);
	moveto(90,58.5+60+x*10+y*10);
	lineto(120,58.5+60+x*10+y*10);

	FOR c:=0 TO (x+y-1) DO BEGIN
	moveto(120+c*10,(58.5+x*10+y*10+60)-c*10);
	lineto(120+c*10-10,(58.5+x*10+y*10+60)-c*10);
	moveto(120+c*10,(58.5+x*10+y*10+30)-c*10);
	lineto(120+c*10-10,(58.5+x*10+y*10+30)-c*10);
	END;

	FOR c:=0 TO (x+y-1) DO BEGIN
	moveto(90-c*10,(58.5+x*10+y*10+60)-c*10);
	lineto(90-c*10+10,(58.5+x*10+y*10+60)-c*10);
	moveto(90-c*10,(58.5+x*10+y*10+30)-c*10);
	lineto(90-c*10+10,(58.5+x*10+y*10+30)-c*10);
	END;
	
	moveto(120+(x-1)*10,58.5+30);
	lineto(120+(x-1)*10+y*10,58.5+30);
	moveto(90-(x-1)*10,58.5+30);
	lineto(90-(x-1)*10-y*10,58.5+30);

	

	{*treppe_3 schnitte*}
	penFore(0,65535,0);
	penPat(2);
		
	FOR e:=0 TO (x+y+z-1) DO BEGIN
	penPat(2);
	penFore(0,65535,0);
	moveto(120+e*10,(58.5+90+x*10+y*10+z*10)-e*10);
	lineto(120+e*10,((58.5+90+x*10+y*10+z*10)-e*10)-40);
	END;

	FOR e:=0 TO (x+y+z-1) DO BEGIN
	penPat(2);
	penFore(0,65535,0);
	moveto(90-e*10,(58.5+90+x*10+y*10+z*10)-e*10);
	lineto(90-e*10,((58.5+90+x*10+y*10+z*10)-e*10)-40);
	END;

	{*treppe_3 ritzen*}
	penFore(65535,0,0);
	penPat(-2);
	moveto(90,58.5+60+x*10+y*10+z*10);
	lineto(120,58.5+60+x*10+y*10+z*10);
	moveto(90,58.5+90+x*10+y*10+z*10);
	lineto(120,58.5+90+x*10+y*10+z*10);

	FOR e:=0 TO (x+y+z-1) DO BEGIN
	moveto(120+e*10,(58.5+x*10+y*10+z*10+90)-e*10);
	lineto(120+e*10-10,(58.5+x*10+y*10+z*10+90)-e*10);
	moveto(120+e*10,(58.5+x*10+y*10+z*10+60)-e*10);
	lineto(120+e*10-10,(58.5+x*10+y*10+z*10+60)-e*10);
	END;

	FOR e:=0 TO (x+y+z-1) DO BEGIN
	moveto(90-e*10,(58.5+x*10+y*10+z*10+90)-e*10);
	lineto(90-e*10+10,(58.5+x*10+y*10+z*10+90)-e*10);
	moveto(90-e*10,(58.5+x*10+y*10+z*10+60)-e*10);
	lineto(90-e*10+10,(58.5+x*10+y*10+z*10+60)-e*10);
	END;

	moveto(120+(x-1)*10+y*10,58.5+60);
	lineto(120+(x-1)*10+y*10+z*10,58.5+60);
	moveto(90-(x-1)*10-y*10,58.5+60);
	lineto(90-(x-1)*10-y*10-z*10,58.5+60);

END;
RUN(doppeltreppe);