Even if the computer has a move that gives an immediate win, it may not make it if it detects another move that is also guaranteed to win. Some early chess programs had the problem that they would get into a repetition of position when a forced win was detected, allowing the opponent to claim a draw. In the Tic-Tac-Toe program this outcome is not a problem because the program eventually will win. Modify the Tic-Tac-Toe algorithm so that when a winning position is found, the move that leads to the shortest win is always taken. You can do so by adding 9-depth to COMPUTER_WIN, so that a quicker win gives the highest value.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here