WeixiangYan/CodeTransOcean huggingface dataset:
Task: Sierpinski triangle



C#: using System;
using System.Collections;

namespace RosettaCode {
    class SierpinskiTriangle {
        int len;
        BitArray b;

        public SierpinskiTriangle(int n) {
            if (n < 1) {
                throw new ArgumentOutOfRangeException("Order must be greater than zero");
            }
            len = 1 << (n+1);
            b = new BitArray(len+1, false);
            b[len>>1] = true;
        }

        public void Display() {
            for (int j = 0; j < len / 2; j++) {
                for (int i = 0; i < b.Count; i++) {
                    Console.Write("{0}", b[i] ? "*" : " ");
                }
                Console.WriteLine();
                NextGen();
            }
        }

        private void NextGen() {
            BitArray next = new BitArray(b.Count, false);
            for (int i = 0; i < b.Count; i++) {
                if (b[i]) {
                    next[i - 1] = next[i - 1] ^ true;
                    next[i + 1] = next[i + 1] ^ true;
                }
            }
            b = next;
        }
    }
}


Go: package main

import (
    "fmt"
    "strings"
    "unicode/utf8"
)

var order = 4
var grain = "*"

func main() {
    t := []string{grain + strings.Repeat(" ", utf8.RuneCountInString(grain))}
    for ; order > 0; order-- {
        sp := strings.Repeat(" ", utf8.RuneCountInString(t[0])/2)
        top := make([]string, len(t))
        for i, s := range t {
            top[i] = sp + s + sp
            t[i] += s
        }
        t = append(top, t...)
    }
    for _, r := range t {
        fmt.Println(r)
    }
}
Task: Sierpinski triangle



C#: using System;
using System.Collections;

namespace RosettaCode {
    class SierpinskiTriangle {
        int len;
        BitArray b;

        public SierpinskiTriangle(int n) {
            if (n < 1) {
                throw new ArgumentOutOfRangeException("Order must be greater than zero");
            }
            len = 1 << (n+1);
            b = new BitArray(len+1, false);
            b[len>>1] = true;
        }

        public void Display() {
            for (int j = 0; j < len / 2; j++) {
                for (int i = 0; i < b.Count; i++) {
                    Console.Write("{0}", b[i] ? "*" : " ");
                }
                Console.WriteLine();
                NextGen();
            }
        }

        private void NextGen() {
            BitArray next = new BitArray(b.Count, false);
            for (int i = 0; i < b.Count; i++) {
                if (b[i]) {
                    next[i - 1] = next[i - 1] ^ true;
                    next[i + 1] = next[i + 1] ^ true;
                }
            }
            b = next;
        }
    }
}





Python: def sierpinski(n):
    d = ["*"]
    for i in xrange(n):
        sp = " " * (2 ** i)
        d = [sp+x+sp for x in d] + [x+" "+x for x in d]
    return d

print "\n".join(sierpinski(4))
Task: Sierpinski triangle



C#: using System;
using System.Collections;

namespace RosettaCode {
    class SierpinskiTriangle {
        int len;
        BitArray b;

        public SierpinskiTriangle(int n) {
            if (n < 1) {
                throw new ArgumentOutOfRangeException("Order must be greater than zero");
            }
            len = 1 << (n+1);
            b = new BitArray(len+1, false);
            b[len>>1] = true;
        }

        public void Display() {
            for (int j = 0; j < len / 2; j++) {
                for (int i = 0; i < b.Count; i++) {
                    Console.Write("{0}", b[i] ? "*" : " ");
                }
                Console.WriteLine();
                NextGen();
            }
        }

        private void NextGen() {
            BitArray next = new BitArray(b.Count, false);
            for (int i = 0; i < b.Count; i++) {
                if (b[i]) {
                    next[i - 1] = next[i - 1] ^ true;
                    next[i + 1] = next[i + 1] ^ true;
                }
            }
            b = next;
        }
    }
}






VB: Sub sierpinski(n As Integer)
    Dim lim As Integer: lim = 2 ^ n - 1
    For y = lim To 0 Step -1
        Debug.Print String$(y, " ")
        For x = 0 To lim - y
            Debug.Print IIf(x And y, "  ", "# ");
        Next
        Debug.Print
    Next y
End Sub
Public Sub main()
    Dim i As Integer
    For i = 1 To 5
        sierpinski i
    Next i
End Sub
Task: Sierpinski triangle




Go: package main

import (
    "fmt"
    "strings"
    "unicode/utf8"
)

var order = 4
var grain = "*"

func main() {
    t := []string{grain + strings.Repeat(" ", utf8.RuneCountInString(grain))}
    for ; order > 0; order-- {
        sp := strings.Repeat(" ", utf8.RuneCountInString(t[0])/2)
        top := make([]string, len(t))
        for i, s := range t {
            top[i] = sp + s + sp
            t[i] += s
        }
        t = append(top, t...)
    }
    for _, r := range t {
        fmt.Println(r)
    }
}


Java: public class SierpinskiTriangle {

    public static void main(String[] args) {
        System.out.println(getSierpinskiTriangle(4));
    }
    
    private static final String getSierpinskiTriangle(int n) {
        if ( n == 0 ) {
            return "*";
        }

        String s = getSierpinskiTriangle(n-1);
        String [] split = s.split("\n");
        int length = split.length;

        
        StringBuilder sb = new StringBuilder();
        String top = buildSpace((int)Math.pow(2, n-1));
        for ( int i = 0 ; i < length ;i++ ) {
            sb.append(top);
            sb.append(split[i]);
            sb.append("\n");
        }
        
        
        for ( int i = 0 ; i < length ;i++ ) {
            sb.append(split[i]);
            sb.append(buildSpace(length-i));
            sb.append(split[i]);
            sb.append("\n");
        }
        return sb.toString();
    }
    
    private static String buildSpace(int n) {
        StringBuilder sb = new StringBuilder();
        while ( n > 0 ) {
            sb.append(" ");
            n--;
        }
        return sb.toString();
    }
    
}
Task: Sierpinski triangle





Java: public class SierpinskiTriangle {

    public static void main(String[] args) {
        System.out.println(getSierpinskiTriangle(4));
    }
    
    private static final String getSierpinskiTriangle(int n) {
        if ( n == 0 ) {
            return "*";
        }

        String s = getSierpinskiTriangle(n-1);
        String [] split = s.split("\n");
        int length = split.length;

        
        StringBuilder sb = new StringBuilder();
        String top = buildSpace((int)Math.pow(2, n-1));
        for ( int i = 0 ; i < length ;i++ ) {
            sb.append(top);
            sb.append(split[i]);
            sb.append("\n");
        }
        
        
        for ( int i = 0 ; i < length ;i++ ) {
            sb.append(split[i]);
            sb.append(buildSpace(length-i));
            sb.append(split[i]);
            sb.append("\n");
        }
        return sb.toString();
    }
    
    private static String buildSpace(int n) {
        StringBuilder sb = new StringBuilder();
        while ( n > 0 ) {
            sb.append(" ");
            n--;
        }
        return sb.toString();
    }
    
}




VB: Sub sierpinski(n As Integer)
    Dim lim As Integer: lim = 2 ^ n - 1
    For y = lim To 0 Step -1
        Debug.Print String$(y, " ")
        For x = 0 To lim - y
            Debug.Print IIf(x And y, "  ", "# ");
        Next
        Debug.Print
    Next y
End Sub
Public Sub main()
    Dim i As Integer
    For i = 1 To 5
        sierpinski i
    Next i
End Sub
Task: Sierpinski triangle




Go: package main

import (
    "fmt"
    "strings"
    "unicode/utf8"
)

var order = 4
var grain = "*"

func main() {
    t := []string{grain + strings.Repeat(" ", utf8.RuneCountInString(grain))}
    for ; order > 0; order-- {
        sp := strings.Repeat(" ", utf8.RuneCountInString(t[0])/2)
        top := make([]string, len(t))
        for i, s := range t {
            top[i] = sp + s + sp
            t[i] += s
        }
        t = append(top, t...)
    }
    for _, r := range t {
        fmt.Println(r)
    }
}




Python: def sierpinski(n):
    d = ["*"]
    for i in xrange(n):
        sp = " " * (2 ** i)
        d = [sp+x+sp for x in d] + [x+" "+x for x in d]
    return d

print "\n".join(sierpinski(4))
Task: Sierpinski triangle




Go: package main

import (
    "fmt"
    "strings"
    "unicode/utf8"
)

var order = 4
var grain = "*"

func main() {
    t := []string{grain + strings.Repeat(" ", utf8.RuneCountInString(grain))}
    for ; order > 0; order-- {
        sp := strings.Repeat(" ", utf8.RuneCountInString(t[0])/2)
        top := make([]string, len(t))
        for i, s := range t {
            top[i] = sp + s + sp
            t[i] += s
        }
        t = append(top, t...)
    }
    for _, r := range t {
        fmt.Println(r)
    }
}





VB: Sub sierpinski(n As Integer)
    Dim lim As Integer: lim = 2 ^ n - 1
    For y = lim To 0 Step -1
        Debug.Print String$(y, " ")
        For x = 0 To lim - y
            Debug.Print IIf(x And y, "  ", "# ");
        Next
        Debug.Print
    Next y
End Sub
Public Sub main()
    Dim i As Integer
    For i = 1 To 5
        sierpinski i
    Next i
End Sub
Task: Sierpinski triangle







Python: def sierpinski(n):
    d = ["*"]
    for i in xrange(n):
        sp = " " * (2 ** i)
        d = [sp+x+sp for x in d] + [x+" "+x for x in d]
    return d

print "\n".join(sierpinski(4))


VB: Sub sierpinski(n As Integer)
    Dim lim As Integer: lim = 2 ^ n - 1
    For y = lim To 0 Step -1
        Debug.Print String$(y, " ")
        For x = 0 To lim - y
            Debug.Print IIf(x And y, "  ", "# ");
        Next
        Debug.Print
    Next y
End Sub
Public Sub main()
    Dim i As Integer
    For i = 1 To 5
        sierpinski i
    Next i
End Sub
Task: Sierpinski triangle

C: #include <stdio.h>

#define SIZE (1 << 4)
int main()
{
	int x, y, i;
	for (y = SIZE - 1; y >= 0; y--, putchar('\n')) {
		for (i = 0; i < y; i++) putchar(' ');
		for (x = 0; x + y < SIZE; x++)
			printf((x & y) ? "  " : "* ");
	}
	return 0;
}



C#: using System;
using System.Collections;

namespace RosettaCode {
    class SierpinskiTriangle {
        int len;
        BitArray b;

        public SierpinskiTriangle(int n) {
            if (n < 1) {
                throw new ArgumentOutOfRangeException("Order must be greater than zero");
            }
            len = 1 << (n+1);
            b = new BitArray(len+1, false);
            b[len>>1] = true;
        }

        public void Display() {
            for (int j = 0; j < len / 2; j++) {
                for (int i = 0; i < b.Count; i++) {
                    Console.Write("{0}", b[i] ? "*" : " ");
                }
                Console.WriteLine();
                NextGen();
            }
        }

        private void NextGen() {
            BitArray next = new BitArray(b.Count, false);
            for (int i = 0; i < b.Count; i++) {
                if (b[i]) {
                    next[i - 1] = next[i - 1] ^ true;
                    next[i + 1] = next[i + 1] ^ true;
                }
            }
            b = next;
        }
    }
}
Task: Sierpinski triangle

C: #include <stdio.h>

#define SIZE (1 << 4)
int main()
{
	int x, y, i;
	for (y = SIZE - 1; y >= 0; y--, putchar('\n')) {
		for (i = 0; i < y; i++) putchar(' ');
		for (x = 0; x + y < SIZE; x++)
			printf((x & y) ? "  " : "* ");
	}
	return 0;
}




Go: package main

import (
    "fmt"
    "strings"
    "unicode/utf8"
)

var order = 4
var grain = "*"

func main() {
    t := []string{grain + strings.Repeat(" ", utf8.RuneCountInString(grain))}
    for ; order > 0; order-- {
        sp := strings.Repeat(" ", utf8.RuneCountInString(t[0])/2)
        top := make([]string, len(t))
        for i, s := range t {
            top[i] = sp + s + sp
            t[i] += s
        }
        t = append(top, t...)
    }
    for _, r := range t {
        fmt.Println(r)
    }
}
Task: Sierpinski triangle

C: #include <stdio.h>

#define SIZE (1 << 4)
int main()
{
	int x, y, i;
	for (y = SIZE - 1; y >= 0; y--, putchar('\n')) {
		for (i = 0; i < y; i++) putchar(' ');
		for (x = 0; x + y < SIZE; x++)
			printf((x & y) ? "  " : "* ");
	}
	return 0;
}







Python: def sierpinski(n):
    d = ["*"]
    for i in xrange(n):
        sp = " " * (2 ** i)
        d = [sp+x+sp for x in d] + [x+" "+x for x in d]
    return d

print "\n".join(sierpinski(4))
Task: Sierpinski triangle

C: #include <stdio.h>

#define SIZE (1 << 4)
int main()
{
	int x, y, i;
	for (y = SIZE - 1; y >= 0; y--, putchar('\n')) {
		for (i = 0; i < y; i++) putchar(' ');
		for (x = 0; x + y < SIZE; x++)
			printf((x & y) ? "  " : "* ");
	}
	return 0;
}








VB: Sub sierpinski(n As Integer)
    Dim lim As Integer: lim = 2 ^ n - 1
    For y = lim To 0 Step -1
        Debug.Print String$(y, " ")
        For x = 0 To lim - y
            Debug.Print IIf(x And y, "  ", "# ");
        Next
        Debug.Print
    Next y
End Sub
Public Sub main()
    Dim i As Integer
    For i = 1 To 5
        sierpinski i
    Next i
End Sub
Task: Sierpinski triangle



C#: using System;
using System.Collections;

namespace RosettaCode {
    class SierpinskiTriangle {
        int len;
        BitArray b;

        public SierpinskiTriangle(int n) {
            if (n < 1) {
                throw new ArgumentOutOfRangeException("Order must be greater than zero");
            }
            len = 1 << (n+1);
            b = new BitArray(len+1, false);
            b[len>>1] = true;
        }

        public void Display() {
            for (int j = 0; j < len / 2; j++) {
                for (int i = 0; i < b.Count; i++) {
                    Console.Write("{0}", b[i] ? "*" : " ");
                }
                Console.WriteLine();
                NextGen();
            }
        }

        private void NextGen() {
            BitArray next = new BitArray(b.Count, false);
            for (int i = 0; i < b.Count; i++) {
                if (b[i]) {
                    next[i - 1] = next[i - 1] ^ true;
                    next[i + 1] = next[i + 1] ^ true;
                }
            }
            b = next;
        }
    }
}



Java: public class SierpinskiTriangle {

    public static void main(String[] args) {
        System.out.println(getSierpinskiTriangle(4));
    }
    
    private static final String getSierpinskiTriangle(int n) {
        if ( n == 0 ) {
            return "*";
        }

        String s = getSierpinskiTriangle(n-1);
        String [] split = s.split("\n");
        int length = split.length;

        
        StringBuilder sb = new StringBuilder();
        String top = buildSpace((int)Math.pow(2, n-1));
        for ( int i = 0 ; i < length ;i++ ) {
            sb.append(top);
            sb.append(split[i]);
            sb.append("\n");
        }
        
        
        for ( int i = 0 ; i < length ;i++ ) {
            sb.append(split[i]);
            sb.append(buildSpace(length-i));
            sb.append(split[i]);
            sb.append("\n");
        }
        return sb.toString();
    }
    
    private static String buildSpace(int n) {
        StringBuilder sb = new StringBuilder();
        while ( n > 0 ) {
            sb.append(" ");
            n--;
        }
        return sb.toString();
    }
    
}
Task: Sierpinski triangle





Java: public class SierpinskiTriangle {

    public static void main(String[] args) {
        System.out.println(getSierpinskiTriangle(4));
    }
    
    private static final String getSierpinskiTriangle(int n) {
        if ( n == 0 ) {
            return "*";
        }

        String s = getSierpinskiTriangle(n-1);
        String [] split = s.split("\n");
        int length = split.length;

        
        StringBuilder sb = new StringBuilder();
        String top = buildSpace((int)Math.pow(2, n-1));
        for ( int i = 0 ; i < length ;i++ ) {
            sb.append(top);
            sb.append(split[i]);
            sb.append("\n");
        }
        
        
        for ( int i = 0 ; i < length ;i++ ) {
            sb.append(split[i]);
            sb.append(buildSpace(length-i));
            sb.append(split[i]);
            sb.append("\n");
        }
        return sb.toString();
    }
    
    private static String buildSpace(int n) {
        StringBuilder sb = new StringBuilder();
        while ( n > 0 ) {
            sb.append(" ");
            n--;
        }
        return sb.toString();
    }
    
}



Python: def sierpinski(n):
    d = ["*"]
    for i in xrange(n):
        sp = " " * (2 ** i)
        d = [sp+x+sp for x in d] + [x+" "+x for x in d]
    return d

print "\n".join(sierpinski(4))
Task: Sierpinski triangle

C: #include <stdio.h>

#define SIZE (1 << 4)
int main()
{
	int x, y, i;
	for (y = SIZE - 1; y >= 0; y--, putchar('\n')) {
		for (i = 0; i < y; i++) putchar(' ');
		for (x = 0; x + y < SIZE; x++)
			printf((x & y) ? "  " : "* ");
	}
	return 0;
}






PHP: <?php

function sierpinskiTriangle($order) {
    $char = '#';
    $n = 1 << $order;
    $line = array();
    for ($i = 0 ; $i <= 2 * $n ; $i++) {
        $line[$i] = ' ';
    }
    $line[$n] = $char;
    for ($i = 0 ; $i < $n ; $i++) {
        echo implode('', $line), PHP_EOL;
        $u = $char;
        for ($j = $n - $i ; $j < $n + $i + 1 ; $j++) {
            $t = ($line[$j - 1] == $line[$j + 1] ? ' ' : $char);
            $line[$j - 1] = $u;
            $u = $t;
        }
        $line[$n + $i] = $t;
        $line[$n + $i + 1] = $char;
    }
}

sierpinskiTriangle(4);
Task: Sierpinski triangle



C#: using System;
using System.Collections;

namespace RosettaCode {
    class SierpinskiTriangle {
        int len;
        BitArray b;

        public SierpinskiTriangle(int n) {
            if (n < 1) {
                throw new ArgumentOutOfRangeException("Order must be greater than zero");
            }
            len = 1 << (n+1);
            b = new BitArray(len+1, false);
            b[len>>1] = true;
        }

        public void Display() {
            for (int j = 0; j < len / 2; j++) {
                for (int i = 0; i < b.Count; i++) {
                    Console.Write("{0}", b[i] ? "*" : " ");
                }
                Console.WriteLine();
                NextGen();
            }
        }

        private void NextGen() {
            BitArray next = new BitArray(b.Count, false);
            for (int i = 0; i < b.Count; i++) {
                if (b[i]) {
                    next[i - 1] = next[i - 1] ^ true;
                    next[i + 1] = next[i + 1] ^ true;
                }
            }
            b = next;
        }
    }
}




PHP: <?php

function sierpinskiTriangle($order) {
    $char = '#';
    $n = 1 << $order;
    $line = array();
    for ($i = 0 ; $i <= 2 * $n ; $i++) {
        $line[$i] = ' ';
    }
    $line[$n] = $char;
    for ($i = 0 ; $i < $n ; $i++) {
        echo implode('', $line), PHP_EOL;
        $u = $char;
        for ($j = $n - $i ; $j < $n + $i + 1 ; $j++) {
            $t = ($line[$j - 1] == $line[$j + 1] ? ' ' : $char);
            $line[$j - 1] = $u;
            $u = $t;
        }
        $line[$n + $i] = $t;
        $line[$n + $i + 1] = $char;
    }
}

sierpinskiTriangle(4);
Task: Sierpinski triangle




Go: package main

import (
    "fmt"
    "strings"
    "unicode/utf8"
)

var order = 4
var grain = "*"

func main() {
    t := []string{grain + strings.Repeat(" ", utf8.RuneCountInString(grain))}
    for ; order > 0; order-- {
        sp := strings.Repeat(" ", utf8.RuneCountInString(t[0])/2)
        top := make([]string, len(t))
        for i, s := range t {
            top[i] = sp + s + sp
            t[i] += s
        }
        t = append(top, t...)
    }
    for _, r := range t {
        fmt.Println(r)
    }
}



PHP: <?php

function sierpinskiTriangle($order) {
    $char = '#';
    $n = 1 << $order;
    $line = array();
    for ($i = 0 ; $i <= 2 * $n ; $i++) {
        $line[$i] = ' ';
    }
    $line[$n] = $char;
    for ($i = 0 ; $i < $n ; $i++) {
        echo implode('', $line), PHP_EOL;
        $u = $char;
        for ($j = $n - $i ; $j < $n + $i + 1 ; $j++) {
            $t = ($line[$j - 1] == $line[$j + 1] ? ' ' : $char);
            $line[$j - 1] = $u;
            $u = $t;
        }
        $line[$n + $i] = $t;
        $line[$n + $i + 1] = $char;
    }
}

sierpinskiTriangle(4);
Task: Sierpinski triangle





Java: public class SierpinskiTriangle {

    public static void main(String[] args) {
        System.out.println(getSierpinskiTriangle(4));
    }
    
    private static final String getSierpinskiTriangle(int n) {
        if ( n == 0 ) {
            return "*";
        }

        String s = getSierpinskiTriangle(n-1);
        String [] split = s.split("\n");
        int length = split.length;

        
        StringBuilder sb = new StringBuilder();
        String top = buildSpace((int)Math.pow(2, n-1));
        for ( int i = 0 ; i < length ;i++ ) {
            sb.append(top);
            sb.append(split[i]);
            sb.append("\n");
        }
        
        
        for ( int i = 0 ; i < length ;i++ ) {
            sb.append(split[i]);
            sb.append(buildSpace(length-i));
            sb.append(split[i]);
            sb.append("\n");
        }
        return sb.toString();
    }
    
    private static String buildSpace(int n) {
        StringBuilder sb = new StringBuilder();
        while ( n > 0 ) {
            sb.append(" ");
            n--;
        }
        return sb.toString();
    }
    
}


PHP: <?php

function sierpinskiTriangle($order) {
    $char = '#';
    $n = 1 << $order;
    $line = array();
    for ($i = 0 ; $i <= 2 * $n ; $i++) {
        $line[$i] = ' ';
    }
    $line[$n] = $char;
    for ($i = 0 ; $i < $n ; $i++) {
        echo implode('', $line), PHP_EOL;
        $u = $char;
        for ($j = $n - $i ; $j < $n + $i + 1 ; $j++) {
            $t = ($line[$j - 1] == $line[$j + 1] ? ' ' : $char);
            $line[$j - 1] = $u;
            $u = $t;
        }
        $line[$n + $i] = $t;
        $line[$n + $i + 1] = $char;
    }
}

sierpinskiTriangle(4);
Task: Sierpinski triangle






PHP: <?php

function sierpinskiTriangle($order) {
    $char = '#';
    $n = 1 << $order;
    $line = array();
    for ($i = 0 ; $i <= 2 * $n ; $i++) {
        $line[$i] = ' ';
    }
    $line[$n] = $char;
    for ($i = 0 ; $i < $n ; $i++) {
        echo implode('', $line), PHP_EOL;
        $u = $char;
        for ($j = $n - $i ; $j < $n + $i + 1 ; $j++) {
            $t = ($line[$j - 1] == $line[$j + 1] ? ' ' : $char);
            $line[$j - 1] = $u;
            $u = $t;
        }
        $line[$n + $i] = $t;
        $line[$n + $i + 1] = $char;
    }
}

sierpinskiTriangle(4);


Python: def sierpinski(n):
    d = ["*"]
    for i in xrange(n):
        sp = " " * (2 ** i)
        d = [sp+x+sp for x in d] + [x+" "+x for x in d]
    return d

print "\n".join(sierpinski(4))
Task: Sierpinski triangle






PHP: <?php

function sierpinskiTriangle($order) {
    $char = '#';
    $n = 1 << $order;
    $line = array();
    for ($i = 0 ; $i <= 2 * $n ; $i++) {
        $line[$i] = ' ';
    }
    $line[$n] = $char;
    for ($i = 0 ; $i < $n ; $i++) {
        echo implode('', $line), PHP_EOL;
        $u = $char;
        for ($j = $n - $i ; $j < $n + $i + 1 ; $j++) {
            $t = ($line[$j - 1] == $line[$j + 1] ? ' ' : $char);
            $line[$j - 1] = $u;
            $u = $t;
        }
        $line[$n + $i] = $t;
        $line[$n + $i + 1] = $char;
    }
}

sierpinskiTriangle(4);



VB: Sub sierpinski(n As Integer)
    Dim lim As Integer: lim = 2 ^ n - 1
    For y = lim To 0 Step -1
        Debug.Print String$(y, " ")
        For x = 0 To lim - y
            Debug.Print IIf(x And y, "  ", "# ");
        Next
        Debug.Print
    Next y
End Sub
Public Sub main()
    Dim i As Integer
    For i = 1 To 5
        sierpinski i
    Next i
End Sub