示例#1
0
        public void isiArrayCopy3()
        {
            int x = 0;

            int[] fibo = Deret.fibo(n1 * n1);


            for (int pindah = 1; pindah <= n2; pindah++)
            {
                int j = 0;
                for (int p = 0; p < baris; p++)
                {
                    for (int q = 0; q < kolom; q++)
                    {
                        if (p + q >= baris - 1 && q - p <= baris - 1) // Sgitiga
                        {
                            array[p, q + x] = fibo[j].ToString();
                            j++;
                        }
                    }
                }
                x = x + totKolom;
            }
            cetakArray();
        }
示例#2
0
        public void isiArrayCopy2()
        {
            int minggir = 0;

            int[] fibo = Deret.fibo(n1 * n1);


            for (int pindah = 1; pindah <= n2; pindah++)
            {
                int i = 0;
                for (int m = 0; m < baris; m++)
                {
                    for (int n = 0; n < kolom; n++)
                    {
                        if (m + n >= baris - 1 && n - m <= baris - 1) // Sgitiga
                        {
                            array[m, n + minggir] = fibo[i].ToString();
                            i++;
                        }
                    }
                }
                minggir = minggir + totKolom;
            }
            cetakArray();
        }
示例#3
0
        public void isiArray() // deret angka
        {
            int geser = 0;

            //int psegitiga = (2 * n1) - 1; // total kolom dalam satu segitiga
            int[] fibo = Deret.fibo(n1 * n1);


            for (int bangun = 1; bangun <= n2; bangun++)
            {
                //int angka = 1;
                int index = 0;
                for (int i = 0; i < baris; i++)
                {
                    for (int j = 0; j < kolom; j++)
                    {
                        if (i + j >= baris - 1 && j - i <= baris - 1) // Sgitiga
                        {
                            array[i, j + geser] = fibo[index].ToString();
                            index++;
                        }
                    }
                }
                geser = geser + totKolom;
            }
            cetakArray();
        }
示例#4
0
        public void isiArrayCopy4()
        {
            int z = 0;

            int[] fibo = Deret.fibo(n1 * n1);


            for (int ganti = 1; ganti <= n2; ganti++)
            {
                int k = 0;
                for (int x = 0; x < baris; x++)
                {
                    for (int y = 0; y < kolom; y++)
                    {
                        if (x + y >= baris - 1 && y - x <= baris - 1) // Sgitiga
                        {
                            array[x, y + z] = fibo[k].ToString();
                            k++;
                        }
                    }
                }
                z = z + totKolom;
            }
            cetakArray();
        }
示例#5
0
        public void Hasil06c()
        {
            int gsr = 0;

            int[] fibon = Deret.fibo(n * n);
            for (int bangun = 1; bangun <= p; bangun++)
            {
                int angka = 0;
                for (int cf = 0; cf < baris; cf++)
                {
                    for (int lm = 0; lm < kolom; lm++)
                    {
                        if (lm + cf >= n - 1 && lm - cf <= n - 1)
                        {
                            array[cf, lm + gsr] = fibon[angka].ToString();
                            angka++;
                        }
                    }
                }
                gsr += pSegitiga;
            }

            CetakData();
        }
示例#6
0
        public void Hasil06b()
        {
            int pindah = 0;

            int[] fibon = Deret.fibo(n * n);
            for (int bangun = 1; bangun <= p; bangun++)
            {
                int angka = 0;
                for (int bn = 0; bn < baris; bn++)
                {
                    for (int vb = 0; vb < kolom; vb++)
                    {
                        if (vb + bn >= n - 1 && vb - bn <= n - 1)
                        {
                            array[bn, vb + pindah] = fibon[angka].ToString();
                            angka++;
                        }
                    }
                }
                pindah += pSegitiga;
            }

            CetakData();
        }
示例#7
0
        public void Hasil06a()
        {
            int geser = 0;

            int[] fibon = Deret.fibo(n * n);
            for (int bangun = 1; bangun <= p; bangun++)
            {
                int angka = 0;
                for (int ef = 0; ef < baris; ef++)
                {
                    for (int sd = 0; sd < kolom; sd++)
                    {
                        if (sd + ef >= n - 1 && sd - ef <= n - 1)
                        {
                            array[ef, sd + geser] = fibon[angka].ToString();
                            angka++;
                        }
                    }
                }
                geser += pSegitiga;
            }

            CetakData();
        }
示例#8
0
        public void Hasil06()
        {
            int geser = 0;

            int[] fibon = Deret.fibo(n * n);
            for (int bangun = 1; bangun <= p; bangun++)
            {
                int angka = 0;
                for (int i = 0; i < baris; i++)
                {
                    for (int j = 0; j < kolom; j++)
                    {
                        if (j + i >= n - 1 && j - i <= n - 1)
                        {
                            array[i, j + geser] = fibon[angka].ToString();
                            angka++;
                        }
                    }
                }
                geser += pSegitiga;
            }

            CetakData();
        }
示例#9
0
        public void Hasil06e()
        {
            int geser = 0;

            int[] fibon = Deret.fibo(n * n);
            for (int bent = 1; bent <= p; bent++)
            {
                int angka = 0;
                for (int ws = 0; ws < baris; ws++)
                {
                    for (int dd = 0; dd < kolom; dd++)
                    {
                        if (dd + ws >= n - 1 && dd - ws <= n - 1)
                        {
                            array[ws, dd + geser] = fibon[angka].ToString();
                            angka++;
                        }
                    }
                }
                geser += pSegitiga;
            }

            CetakData();
        }
示例#10
0
        public void Hasil06d()
        {
            int geser = 0;

            int[] fibon = Deret.fibo(n * n);
            for (int bentuk = 1; bentuk <= p; bentuk++)
            {
                int angka = 0;
                for (int dd = 0; dd < baris; dd++)
                {
                    for (int cv = 0; cv < kolom; cv++)
                    {
                        if (cv + dd >= n - 1 && cv - dd <= n - 1)
                        {
                            array[dd, cv + geser] = fibon[angka].ToString();
                            angka++;
                        }
                    }
                }
                geser += pSegitiga;
            }

            CetakData();
        }