You start out with a number of "control points". Gasket represents these points
with small, colored rectangles, like this:
Next, pick any location on the picture as a starting location.
Then, you repeat the following process over and over:
If the process is repeated fewer than, say, a hundred times, there it will not be easy to see
a pattern. However, as several hundred points are plotted, a pattern begins to emerge.
This pattern is an approximation to a fractal known as the Sierpinski Gasket (which is
where the program got its name). A few thousand points will give a good idea of what
the Sierpinski gasket looks like. Here's an example with ten thousand points plotted:
(In this picture, the chosen starting point was above and to the left of the
line segment joining the red and green control points.)
There are many things that can be done to alter the process described above to get different final images. For example, instead of moving halfway to the selected point every time, we could move some other fraction of the distance. We could also vary the probability of choosing each point, so that, for example, one point would be chosen twice as often as the others. Here's the same run as above, except with the red point chosen twice as often as either the blue or the green point: