title: Simplest and possibly most efficient way to check for data in a line in an array
body: <p>I'm making a Connect 4 Console game in C#. I have all the application set up and working correctly except the <code>hasGameBeenWon()</code> function. The function is called in the Main do...while loop and returns false when the game has not been won.</p>
  
  <pre><code>    static bool gameHasEnded(int currentTurn)
      {
          int currentTurnPiece;
  
          if (currentTurn.Equals(1))
          {
              currentTurnPiece = BLUE;
          }
          else if (currentTurn.Equals(2))
          {
              currentTurnPiece = RED;
          }
  
          return false;
      }
  </code></pre>
  
  <p>(obviously, this code is incomplete)</p>
  
  <p>...Is how it current looks, the <code>currentTurn</code> var is int value of the current player's turn (it can be either 1 or 2). BLUE and RED are constants that are assigned the values of 1 and 2 that are converted into Blue and Red colours on the board when the application prints to the console.</p>
  
  <p>Now I'm stuck on how to check if the game has been won efficiently and as simple as possible. The board is stored in an Array called <code>board</code>, I need to check to see if there is a set of 4 same-values going up/down, left/right and also diagonal in all directions. The checking up/down and left/right is not that hard, but the diagonal I thought maybe a little slow in having to check every single time.</p>
  
  <p>Is there anyway I could speed up checking the entire board or possibly skip checking the entire board altogether and possibly searching just the relevant areas?</p>