Sierpinski gasket

Sierpinski gasket from Khan Academy


  1. Determine the smallest unit of a square will be. If it reaches that size, then fill it with a solid color.
  2. Otherwise, divide the square into four squares. Recursively draw a Sierpinski gasket on the top-left square, top-right square and bottom-right square.


See the Pen by cuadraman (@cuadraman) on CodePen.

results matching ""

    No results matching ""