Open scorpi4n opened 2 years ago
The getMoves and minimax functions don't call togglePlayer, so it's as if one player is trying to outsmart themself.
getMoves
minimax
togglePlayer
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.
minimax(gameboard.board, 2, true)
The
getMoves
andminimax
functions don't calltogglePlayer
, so it's as if one player is trying to outsmart themself.