#๐ AI search algorithm in TicTacToe
11 messages ยท Page 1 of 1 (latest)
@lusty flower
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
I know my evaluation function is kind of shit but I want to get the depth limiting first before going back to improve the function
when i do
return max(game.actions(state), key=lambda a: min_value(game.result(state, a), 0))
it should compare every action with the heuristic value i assigned to it, and then return the action with the highest/max value. But when I run it i am getting some sort of error because my game forces a draw and ends. which means the value returned from my minmax_cutoff likely isnt an action. Could it also be that the evaluation function is not working properly and so its messing up my minmax_cutoff? i feel like i have tried everything
nevermind i debugged it and it was because i was calling evaluation with a player parameter when the function does have one. thanks for the help guys!
with tictactoe 3x3 you can discover all branches at any depth
That might be interesting to you to create a minimax for a tictactoe with a larger grid
its tictactoe on any board size. i am doing minmax, minmax with cutoff, alpha beta, alpha with cutoff, and expectimax with cutoff.
my evaluation function isnt as good as it could be but its good enough for now
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.