I’m making my first little game and I have gotten up to the part where I am trying to work out how I am going to do the AI, as I am new to this im not to sure how to go about it… the best way that I can think of would be to use quite a few if statements to determine where the “cpu” will go next…
Eg:
Where pos[0][0] is row “0” column “0”Code:if (pos[0][0] && pos[0][1] == 'X') {pos[0][2] = 'O';}
Is that the best way to create “AI” for a tictactoe game? Or is there a better more effect method?