Skip to content

Not working if the game is completed in more than 3 steps #1

Description

@quitefounder

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();
}

tictactoe-bug

Any fix identified?

Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions