REM ピタゴラスの木
PICTURE tree(n)
IF n>=0 THEN
PLOT AREA : 0,0; 1,0; 1,1; 0,1
DRAW tree(n-1) WITH SCALE(4/5)*ROTATE(ACOS(4/5))*SHIFT(0,1)
DRAW tree(n-1) WITH SHIFT(-1,0)*SCALE(3/5)*ROTATE(-ACOS(3/5))*SHIFT(1,1)
END IF
END PICTURE
SET WINDOW -4,4,-2,6
DRAW tree(10)
END

