REM Dragon curve
OPTION ARITHMETIC COMPLEX
SET WINDOW -1/2,3/2,-1,1
SET POINT STYLE 1
LET i=SQR(-1)
LET alpha=(1+i)/2
PICTURE D(n)
   IF n=0 THEN    
      PLOT POINTS:0,0
   ELSE
      DRAW D(n-1) WITH SCALE(alpha)
      DRAW D(n-1) WITH SCALE(-alpha)*SHIFT(1)
   END IF
END PICTURE
DRAW D(20)
END
