REM A Christmas Fractal Drawing by David Marples REM Merry Christmas to you all! MODE 21 REM Parameters: centre point (x and y), REM number of points of polygon, REM starting angle (to rotate whole pattern) REM Starting side length REM Ratio between sides of consecutive generations REM Starting colour PROCDraw(800,600,8,0,350,0.40,1) END : DEFPROCDraw(px%,py%,np%,sa,r,dr,c%) LOCAL p%(),x% DIM p%(np%,1) IF c%>15 THEN c%=1 GCOL c% FOR x%=0 TO np% p%(x%,0)=px%+r*COSRAD(sa+x%*360/np%) p%(x%,1)=py%+r*SINRAD(sa+x%*360/np%) CIRCLE FILL p%(x%,0),p%(x%,1),r*dr NEXT x% FOR x%=0 TO np%-1 LINE p%(x%,0),p%(x%,1),p%(x%+1,0),p%(x%+1,1) NEXT x% IF r>16 THEN FOR x%=0 TO np%-1 PROCDraw(p%(x%,0),p%(x%,1),np%,sa,r*dr,dr,c%+1) NEXT x% ENDIF ENDPROC