Auto generated tic-tac-toe
<p>this is working</p>

<pre><code>            int index = 0;

        for (int i = 0; i != ROWS; i++)
        {
            for (int n = 0; n != COLS; n++)
            {
                if (gameArray[i, n] == 1)
                {
                    labels[index].Text = "X";
                }
                else if (gameArray[i, n] == 0)
                {
                    labels[index].Text = "O";
                }
                index += 1;
            }
        }
</code></pre>

<p>I'm doing an automated tic-tac-toe game in c#. I can only get the labels to display either all X's or all O's its never mixed its one or the other in all 9 labels. Below is how I am getting the x or o values.</p>

<pre><code>// initialize our game array
for (int i = 0; i != ROWS; i++)
{
    for (int j = 0; j != COLS; j++)
    {
        gameArray[i, j] = rand.Next(0, 2);
    }
}

// Add the x's and o's to our labels
foreach (int item in gameArray)
{
    foreach (Label myLabel in labels)
    {
        if (item == 1)
            myLabel.Text = "X";
        if (item == 0)
            myLabel.Text = "O";
    }
}
</code></pre>
