! Koch curve
PICTURE Koch(n)
   IF n=0 THEN 
      PLOT AREA : 0,0; 3,0; 3/2, SQR(3)/2; 0,0
   ELSE
      DRAW Koch(n-1) WITH SCALE(1,-1)*ROTATE(alfa)*SCALE(r) 
      DRAW Koch(n-1) WITH SHIFT(-3,0)*SCALE(1,-1)*ROTATE(-alfa)*SCALE(r)*SHIFT(3,0)
   END IF
END PICTURE
LET r=SQR((3/2)^2+(SQR(3)/2)^2) / 3
LET alfa=ANGLE(3/2,SQR(3)/2)
SET WINDOW 0,3,0,3
SET POINT STYLE 1
FOR n=0 TO 12
   CLEAR
   DRAW Koch(n)
   WAIT DELAY 1
NEXT n
END
