scorpi4n / TOP-tic-tac-toe

0 stars 0 forks source link

The current player doesn't change when calling the minimax function #3

Open scorpi4n opened 2 years ago

scorpi4n commented 2 years ago

The getMoves and minimax functions don't call togglePlayer, so it's as if one player is trying to outsmart themself.

scorpi4n commented 2 years ago

The player is toggled correctly now, but only with certain parameters. minimax(gameboard.board, 2, true) seems to be the only function call that works correctly.