SverreNystad / board-master

BoardMaster utilizes the power of the Minimax algorithm, to simulate the best AI opponents one can face in simple board games.
MIT License
3 stars 0 forks source link

TicTacToe.isTerminal() does not always work #20

Closed SverreNystad closed 10 months ago

SverreNystad commented 10 months ago

image

The board state:

| x | - | x |
| o | o | o |  
| - | x | - |

state.isTerminal() == False

This bug makes the Minimax not see this as a final state and makes it chose nonoptimal moves

SverreNystad commented 10 months ago

This is now fixed, and test cases in place to keep it working

SverreNystad commented 10 months ago

Bug was caused by the variable being put in the wrong place: image