Task
Produce an ASCII representation of a Sierpinski triangle of order   N.



Example
The Sierpinski triangle of order   4   should look like this:

                       *
                      * *
                     *   *
                    * * * *
                   *       *
                  * *     * *
                 *   *   *   *
                * * * * * * * *
               *               *
              * *             * *
             *   *           *   *
            * * * *         * * * *
           *       *       *       *
          * *     * *     * *     * *
         *   *   *   *   *   *   *   *
        * * * * * * * * * * * * * * * *



Related tasks
 Sierpinski triangle/Graphical for graphics images of this pattern. 
 Sierpinski carpet


nOrder=4
dim xy$(40)
for i = 1 to 40
    xy$(i) = "                               "
next i
call triangle 1, 1, nOrder
for i = 1 to 36
    print xy$(i)
next i
end
 
SUB triangle x, y, n
    IF n = 0 THEN
        xy$(y) = left$(xy$(y),x-1) + "*" + mid$(xy$(y),x+1)
    ELSE
        n=n-1
        length=2^n
        call triangle x, y+length, n
        call triangle x+length, y, n
        call triangle x+length*2, y+length, n
    END IF
END SUB