title: My program crashes while comparing elements in array
body: <p>Hi I need help with my program. Part of code does not seem to work as expected: </p>
  
  <pre><code>void up(int pole[4][4])
  {
  
  int i,j;
  
  for (i = 3; i &gt;= 1; i--)
  {
      for (j = 3; j &gt;= 0; i--)
      {
          if (pole[i][j] == pole[i-1][j])
          {
              pole[i-1][j] += pole[i][j];
              pole[i][j] = 0;
          }
      }
  }
  
  system("cls");
  
  for (i = 0; i &lt; 4; i++)
  {
      for(j = 0; j &lt; 4; j++)
      {
          printf("%d ", pole[i][j]);
      }
      printf("\n");
  }
  } 
  </code></pre>
  
  <p>when I call the function up in switch like this:</p>
  
  <pre><code>    switch(keynumber)
      {
      case 119: //w
          up(base);
          break;    
  </code></pre>
  
  <p>I just end up with my program crashing.
  The reason why I am doing this is that I want to make 2048 game in console so first I created an array of which 2 random elements of the array will be the number 2 and then I compare these elements depending on which key you will push.</p>