REM Peano curve
PICTURE P(n)   
   IF n=6 THEN 
      WAIT DELAY 0.1
      SELECT CASE t
      CASE 1
         PLOT LINES:  0.4,0.2; 0.6,0.2; 
      CASE 2
         SET AREA COLOR c
         LET c=c+1
         PLOT AREA : 0,0; 1,0; 0.5,0.5
      END SELECT
   ELSE 
      DRAW P(n+1) WITH SCALE(1,-1)*ROTATE(PI/4)*SCALE(1/SQR(2))
      DRAW P(n+1) WITH SHIFT(-1,0)*ROTATE(PI/4)*SCALE(1,-1)*SCALE(1/SQR(2))*SHIFT(1,0) 
   END IF
END PICTURE
SET WINDOW 0,1,0,1  
SET LINE COLOR 1
SET beam mode "IMMORTAL"
LET c=64
LET t=1          
DRAW P(0)
PLOT lines
LET t=2
DRAW P(0)
LET t=1          
DRAW P(0)
END
 
