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: 




path subtriangle(path p, real node) {
    return
        point(p, node) --
        point(p, node + 1/2) --
        point(p, node - 1/2) --
        cycle;
}
 
void sierpinski(path p, int order) {
    if (order == 0)
        fill(p);
    else {
        sierpinski(subtriangle(p, 0), order - 1);
        sierpinski(subtriangle(p, 1), order - 1);
        sierpinski(subtriangle(p, 2), order - 1);
    }
}
 
sierpinski((0, 0) -- (5 inch, 1 inch) -- (2 inch, 6 inch) -- cycle, 10);