Sierpinski Triangle: Come up with three vertices of an equilateral triangle, and pick one randomly. Place another point halfway from this point to another randonly chosen vertex. Pich another random vertex of the triangle from the new point, and place another point halfway in between the two. Continue this process for as long as you want, and it should generate the fractal.

Sierpinski Carpet: Same rules as the triangle, but there are eight vertices (one at every corner, and one at the middle of each side of the rectangle).

NOTE: The more points you choose to draw, the more well defined the resulting, ordered pattern will be.

NOTE ALSO: Please be patient, as it may take a few seconds for the calculations to completely finish depending on how many dots you choose to draw. Then, the window will be displayed and painted with the desired pattern.