The Sierpinski triangle is a fractal that starts with one triangle, then draws a triangle in the middle. That forms 4 new triangles, and a new triangle is drawn in the middle of every triangle formed except the middle one. This is continued for every "sub-triangle" that is formed. Just change the number of iterations to determine how many times you want to try it, then click the green flag to redraw. It stops at 7 because beyond that, you can't see more triangles. Run in turbo mode for it to go faster, or keep it in regular mode to look cooler.
This is based on a PHP script I wrote earlier (https://gist.github.com/jacob-g/2ba376f1329b73379d4b). I wrote that script to practice my usage of algorithms. #fractal #sierpinski