Advertisement
Guest User

Stackoverflow did not recognize the code, sorry for the inc

a guest
Sep 19th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.08 KB | None | 0 0
  1.     class txt_program
  2.     {
  3.         public void txt()
  4.         {
  5.             /* 0 */
  6.             int[] M_array_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
  7.             /* 1 */
  8.             int[] M_array_1 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
  9.             /* 2 */
  10.             int[] M_array_2 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
  11.             // etc.
  12.  
  13.             // the M matrix
  14.             int[][] M = { M_array_0, M_array_1, M_array_2, M_array_3, M_array_4,
  15.             M_array_5, M_array_6, M_array_7, M_array_8, M_array_9, M_array_10,
  16.             M_array_12, M_array_13 };
  17.  
  18.             // the time pick is beeing called into this item.
  19.             Time_pick_2 T2 = new Time_pick_2();
  20.  
  21.             // the if loop making
  22.  
  23.             // 0
  24.             if (T2.M_build_0() == true)
  25.             {
  26.                 int nr_0 = 0;
  27.                 for (int i = nr_0; i < nr_0 + 2; i++)
  28.                 {
  29.                     M[1][i] = M_array_0[i] + 1;
  30.                 }
  31.             }
  32.  
  33.             // 1
  34.             else if (T2.M_build_1() == true)
  35.             {
  36.                 int nr_1 = 1;
  37.                 for (int i = nr_1; i < nr_1 + 2; i++)
  38.                 {
  39.                     M[1][i] = M_array_1[i] + 1;
  40.                 }
  41.             }
  42.  
  43.             // 2
  44.             else if (T2.M_build_2() == true)
  45.             {
  46.                 int nr_2 = 2;
  47.                 for (int i = nr_2; i < nr_2 + 2; i++)
  48.                 {
  49.                     M[2][i] = M_array_2[i] + 1;
  50.  
  51.                 }
  52.             }
  53.  
  54.             // etc.
  55.            
  56.              
  57.  
  58.             using (StreamWriter SW = new StreamWriter(@"txt.txt"))
  59.                 {
  60.                     // the loops creating the .txt-file.
  61.                     for (int i = 0; i < M.GetLength(0); i++)
  62.                     {
  63.                         for (int a = 0; a < 13; a++)
  64.                         {
  65.                             SW.Write(" " + M[i][a]);
  66.                         }
  67.                         SW.WriteLine(M);
  68.                     }
  69.                 }
  70.             }
  71.         }
  72.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement