Even if the computer has a move that gives an immediate win, it may not make it if it detects…

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 %DEPTH to COMPUTER-WIN, SO that a quicker win gives the highest value.