! Koch curve
PICTURE Koch(n)
   IF n=6 THEN
      PLOT LINES:0,0;1,0
   ELSE
      DRAW Koch(n+1) WITH SCALE(1/3) 
      DRAW Koch(n+1) WITH SCALE(1/3)*ROTATE(PI/3)*SHIFT(1/3,0)
      DRAW Koch(n+1) WITH SCALE(1/3)*ROTATE(-PI/3)*SHIFT(1/2,SQR(3)/6)
      DRAW Koch(n+1) WITH SCALE(1/3)*SHIFT(2/3,0)
   END IF
END picture
SET WINDOW 0,1,0,1
DRAW Koch(0)
END
