!PROGRAM SIERPINSKI GASKET

CLEAR

SET MODE "GRAPHICS"

SET WINDOW -.05,1.33,-.05,1

PICTURE TRIANGLE1

PLOT 0,0;1,0;0.5,.866;0,0

FLOOD .5,.433

END PICTURE

DRAW TRIANGLE1

PAUSE 1

CLEAR

PICTURE TRIANGLE2

DRAW TRIANGLE1 WITH SCALE (1/2,1/2)

DRAW TRIANGLE1 WITH SCALE (1/2,1/2)*SHIFT (0.5,0)

DRAW TRIANGLE1 WITH SCALE (1/2,1/2)*SHIFT (0.25,0.433)

END PICTURE

DRAW TRIANGLE2

PAUSE 1

CLEAR

PICTURE TRIANGLE3

DRAW TRIANGLE2 WITH SCALE (1/2,1/2)

DRAW TRIANGLE2 WITH SCALE (1/2,1/2)*SHIFT (0.5,0)

DRAW TRIANGLE2 WITH SCALE (1/2,1/2)*SHIFT (0.25,0.433)

END PICTURE

DRAW TRIANGLE3

PAUSE 1

CLEAR

PICTURE TRIANGLE4

DRAW TRIANGLE3 WITH SCALE (1/2,1/2)

DRAW TRIANGLE3 WITH SCALE (1/2,1/2)*SHIFT (0.5,0)

DRAW TRIANGLE3 WITH SCALE (1/2,1/2)*SHIFT (0.25,0.433)

END PICTURE

DRAW TRIANGLE4

PAUSE 1

CLEAR

PICTURE TRIANGLE5

DRAW TRIANGLE4 WITH SCALE (1/2,1/2)

DRAW TRIANGLE4 WITH SCALE (1/2,1/2)*SHIFT (0.5,0)

DRAW TRIANGLE4 WITH SCALE (1/2,1/2)*SHIFT (0.25,0.433)

END PICTURE

DRAW TRIANGLE5

PAUSE 1

CLEAR

PICTURE TRIANGLE6

DRAW TRIANGLE5 WITH SCALE (1/2,1/2)

DRAW TRIANGLE5 WITH SCALE (1/2,1/2)*SHIFT (0.5,0)

DRAW TRIANGLE5 WITH SCALE (1/2,1/2)*SHIFT (0.25,0.433)

END PICTURE

DRAW TRIANGLE6

PAUSE 1

CLEAR

PICTURE TRIANGLE7

DRAW TRIANGLE6 WITH SCALE (1/2,1/2)

DRAW TRIANGLE6 WITH SCALE (1/2,1/2)*SHIFT (0.5,0)

DRAW TRIANGLE6 WITH SCALE (1/2,1/2)*SHIFT (0.25,0.433)

END PICTURE

DRAW TRIANGLE7

END