Produce a graphical representation of a Sierpinski triangle of order N in any orientation.

An example of Sierpinski's triangle (order = 8) looks like this: 




import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
 
triangle = eqTriangle # fc black # lw 0
 
reduce t =     t
              ===
           (t ||| t)
 
sierpinski = iterate reduce triangle
 
main = defaultMain $ sierpinski !! 7
 