title: C# Tic Tac Toe Efficiency
body: <p>I've made a tic tac toe in C# but I've hardcoded some lines so I was wondering if there were more efficient ways of doing things.</p>
  
  <p>So first off, I have an array of PictureBoxes</p>
  
  <pre><code>PictureBox[] picBoxes = new PictureBox[NUM_OF_SPACES];
  </code></pre>
  
  <p>and it's initialized with my pictures</p>
  
  <pre><code>picBoxes = new PictureBox[] { picBox0, picBox1, picBox2, picBox3, picBox4, picBox5, picBox6, picBox7, picBox8 };
  </code></pre>
  
  <p>I was wondering if there was a better way of checking who won using my array of pictureboxes because currently I have </p>
  
  <pre><code>if(picBox0.Tag == "X" &amp;&amp; picBox1.Tag == "X" &amp;&amp; picBox2.Tag == "X")
          {
              gameOver = true;
              finalMessage = "X is the winner";
          }
  </code></pre>
  
  <p>8 times for X and another 8 for O.  So what I was wondering is if there's a better way to check who won using arrays, like comparing the picBox[] to an array of winners or something.</p>