This quick and easy approach for the Tic Tac Toe game algorithm. One issue I have noticed is that the game works perfectly well if I win on the 3rd click. But, if I win on the 4th step it is not being counted and always return 'Game tied'.
This is because the below condition fails on the 4th click game win,
if(winningPosition && currentPlayerPositions === winningPosition){
game.announceWinner();
}

Any fix identified?
Thanks.
This quick and easy approach for the Tic Tac Toe game algorithm. One issue I have noticed is that the game works perfectly well if I win on the 3rd click. But, if I win on the 4th step it is not being counted and always return 'Game tied'.
This is because the below condition fails on the 4th click game win,
Any fix identified?
Thanks.