コード例 #1
0
ファイル: PR2.cs プロジェクト: dearmhmdr/PRdear1
 private void IsiArray(int n)
 {
     int[] fibo = FunctionBase.tribonacci(JmlhBaris * JmlhKolom);
     for (int bangun = 0; bangun < n; bangun++)
     {
         int angka      = 0;
         int StartBaris = JmlhBaris - 1 - ((bangun * bangun + bangun) / 2);
         int StartKolom = JmlhKolom - 1 - (bangun * bangun);
         int EndBaris   = StartBaris - (bangun);
         int EndKolom   = StartKolom - (bangun * 2);
         for (int b = 0; b <= StartBaris; b++)
         {
             for (int k = StartKolom; k >= EndKolom; k--)
             {
                 if (b + k >= EndKolom + StartBaris && k - b <= StartKolom - StartBaris)
                 {
                     Array2D[b, k] = fibo[angka++].ToString();
                 }
             }
         }
     }
 }