Produce a graphical representation of a Sierpinski triangle of order N in any orientation.

An example of Sierpinski's triangle (order = 8) looks like this: 




 
PROGRAM SIERPINSKY
 
!$INCLUDE="PC.LIB"
 
BEGIN
   ORDER%=8
   SIZE%=2^ORDER%
   SCREEN(9)
   GR_WINDOW(0,0,520,520)
   FOR Y%=0 TO SIZE%-1 DO
     FOR X%=0 TO SIZE%-1 DO
        IF (X% AND Y%)=0 THEN PSET(X%*2,Y%*2,2) END IF
     END FOR
   END FOR
   GET(K$)
END PROGRAM
 