Hello, I've been working on basic A.I. algorithms in C++ over the last week and I've hit a wall. I've written a basic hard-coded logic FSM TicTacToe game and I then attempted to implimented a Minimax algorithm using the information provided in the following post:
I've created an implimentation based upon what I believe to be correct and I'm getting odd results. The algorithm seems to select the correct move after two incorrect moves. Can anyone see where I've gone wrong? Any help would be greatly appreciated.
Note: The grid is an array, with 0,0 being top left.
I could not work out the correct way to format code so I've put it in a pastebin link. I hope this is okay.