title: Connect 4 check if player wins
body: <p>Im creating a connect 4 game in C that runs on the terminal, and i'm having difficulty in the checks area, i'll post that functions code rigth bellow, but is this enough to check all the possibilities of wining the game?</p>
  
  <pre><code>int checkResult()
  {
  
      int i,j,k,count;
      for(i=0;i&lt;sizeWidth;i++)
      {
          for(j=0;j&lt;sizeHeight-3;j++)
          {
              //checks horizontal win
              if(board[i][j] != 0 &amp;&amp; board[i][j]==board[i][j+1] &amp;&amp; board[i][j]==board[i][j+2] &amp;&amp; board[i][j]==board[i][j+3])
                  return 1;
              //checks vertical win
              if(board[i][j] != 0 &amp;&amp; board[i][j]==board[i+1][j] &amp;&amp; board[i][j]==board[i+2][j] &amp;&amp; board[i][j]==board[i+3][j])
                  return 1;
  
              //checks diagonal win
              count = 0;
              for(k=1;k&lt;4;k++)
              {
                  if(board[i][j] == board[i+k][j+k] &amp;&amp; board[i][j]!=0)
                      count++;
                  else
                      count = 0;
                  if(count == 3)
                      return 1;
              }
          }
      }
      return 0;
  }
  </code></pre>