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


sub rep$(n, c$)
    local i, s$
 
    for i = 1 to n
	s$ = s$ + c$ 
    next
    return s$
end sub
 
sub sierpinski(n)
    local lim, y, x
 
    lim = 2**n - 1
    for y = lim to 0 step -1
        print rep$(y, " ");
        for x = 0 to lim-y
            if and(x, y) then print "  "; else print "* "; end if
        next
        print
    next
end sub
 
for i = 1 to 5
    sierpinski(i)
next
 