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


sierpinski = proc (size: int) returns (string)
    ss: stream := stream$create_output()
 
    for i: int in int$from_to(0, size*4-1) do
        c: int := 1
        for j: int in int$from_to(1, size*4-1-i) do
            stream$putc(ss, ' ')
        end
        for k: int in int$from_to(0, i) do
            if c//2=0 then 
                stream$puts(ss, "  ")
            else
                stream$puts(ss, " *")
            end
            c := c*(i-k)/(k+1)
        end
        stream$putc(ss, '\n')
    end
    return(stream$get_contents(ss))
end sierpinski
 
start_up = proc ()
    stream$puts(
        stream$primary_output(),
        sierpinski(4)
    )
end start_up