-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Web version: https://loftyyyy.github.io/TicTacWeb/
Description
When playing the following move sequence:
1 → 3 → 9 → 8
the minimax algorithm incorrectly blocks instead of winning.
Specifically, it places its move on cell 7 instead of cell 4, which would result in an immediate win.
Expected Behavior
The AI should recognize the winning opportunity and place its move on cell 4 to win the game.
Actual Behavior
The AI chooses cell 7, blocking the opponent rather than taking the win.
Steps to Reproduce
-
Start a new Tic-Tac-Toe game.
-
Play the following sequence of moves:
- Player: 1
- AI: (auto)
- Player: 3
- AI: (auto)
- Player: 9
- AI: (auto)
- Player: 8
-
Observe that the AI selects cell 7 instead of the winning cell 4.
Possible Cause
- The evaluation or scoring function might be prioritizing blocking moves over winning moves.
- The minimax recursion may not properly return the highest evaluated score for immediate wins.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers