This is my 1st game and got told to make tig tag toe in c#. Iv got 2 player wolker but now trying 1 player (AI). but do not know where to start. Know the rules eg if center is empty, if plaery 1 has 2 in row block … but dont know how to get AI to click on button for 2 player i have
if (GUI.Button (new Rect (100, 240, 50, 50), counter1, box)&& hasBeenPressed1)
{
if (player == 1)
{
counter1 = "X";
player ++;
turnCount ++;
p1row1 ++;
p1col1 ++;
p1cro1 ++;
} else {
counter1 = "O";
player --;
turnCount ++;
p2row1 ++;
p2col1 ++;
p2cro1 ++;
}
hasBeenPressed1 = false;
}
on each box can some one please point me in the right way thanks