PICTURE D(n)
   IF n=0 THEN 
      SET AREA COLOR 2
      PLOT AREA: 0,0; 1/2,0; 1/2,1/2
      SET AREA COLOR 3
      PLOT AREA: 1,0; 1/2,0; 1/2,1/2
   ELSE 
      DRAW D(n-1) WITH ROTATE(alfa)*SCALE(r)
      DRAW D(n-1) WITH SCALE(1,-1)*SHIFT(-1,0)*ROTATE(-alfa)*SCALE(r)*SHIFT(1,0)
   END IF
END PICTURE
LET alfa=PI/4
LET r=1/sqr(2)
SET WINDOW -1/2,3/2,-1,1
FOR n=0 TO 15
   CLEAR
   DRAW D(n)
   WAIT DELAY 1
NEXT n
END

