10 BITMAP 1 NEW 1280,800
20 SPRITE 1 BIND BITMAP 1 SHOW FLIP 1
30 TARGET BITMAP 1
40 cx=600
50 cy=0
60 DrawTree(13,600,300,PI/2,65)
70 END
80 FUNCTION DrawTree(i,x,y,a,l)
90     SHARE cx,cy
100     da=0.4
110     LINE cx,cy,x,y
120     IF i=0 THEN EXIT FUNCTION
130     cx=x
140     cy=y
150     DrawTree(i-1,x+l*COS(a-da),y+l*SIN(a-da),a-da,l*0.9)
160     cx=x
170     cy=y
180     DrawTree(i-1,x+l*COS(a+da),y+l*SIN(a+da),a+da,l*0.9)
190 END FUNCTION
