Hello -
The code that I have below works .. but I am sure that there must be a more efficient way of looping through to check for a winner. Any advice much appreciated ... thanks:).
if ((nandcButton[0,0].Text == "0") && (nandcButton[0,1].Text == "0") && (nandcButton[0,2].Text == "0") || (nandcButton[1,0].Text == "0") && (nandcButton[1,1].Text == "0") && (nandcButton[1, 2].Text == "0") || (nandcButton[2, 0].Text == "0") && (nandcButton[2, 1].Text == "0") && (nandcButton[2, 2].Text == "0")
|| (nandcButton[0,0].Text == "0") && (nandcButton[1,0].Text == "0") && (nandcButton[2,0].Text == "0") || (nandcButton[0,1].Text == "0") && (nandcButton[1,1].Text == "0") && (nandcButton[2, 1].Text == "0") || (nandcButton[0, 2].Text == "0") && (nandcButton[1, 2].Text == "0") && (nandcButton[2, 2].Text == "0")
|| (nandcButton[0,0].Text == "0") && (nandcButton[1,1].Text == "0") && (nandcButton[2,2].Text == "0") || (nandcButton[2,0].Text == "0") && (nandcButton[1,1].Text == "0") && (nandcButton[0, 2].Text == "0"))
//try
{
Form mynewForm = new winnerForm(p1NameTextBox.Text, p2NameTextBox.Text);//show if NAUGHTS wins - pass winner and score
mynewForm.Show();
pOneScore = pOneScore + 1;
string play1name = (p1NameTextBox.Text);
}