This question already has an answer here:

For today's fractal challenge, draw at least 5 iterations of Sierpinski's triangle! (Shown below is Sierpinski's trinagle)

enter image description here

The resolution of the image must be sufficent that the smallest triangles are at least one pixel in size, and all triangles should be approximately equillateral - pixel art that draws a right-triangle variant will be appreciated, but not accepted. Shortest code in bytes wins!


marked as duplicate by Magic Octopus Urn, Oliver Ni, Community Nov 18 '16 at 17:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.