Questions tagged [tic-tac-toe]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
21 views

In Lab0 - Tic-Tac-Toe, calling the result function causes the error "local variable 'result' referenced before assignment"

I have the following code in the tictactoe module: def result(board, action): nextPlayer = player(board) board[action[0]][action[1]]=nextPlayer return board This works fine when called ...
0
votes
0answers
16 views

CS50-ai Minimax algorithm is not responsive

I have implemented my minimax() algorithm. My ai is smart enough to find a solution that leads to a victory. However, it completely disregards the optimal move the enemy could do. This way, it is ...
1
vote
1answer
1k views

CS50AI Tic tac toe game with minimax algorithm: I keep receive Invalid move

So my code run, but only the first move, after that I keep getting "Invalid move" message (which was declared by myself) in my result function. I'm not sure what's wrong with my result function, or I ...