miniMax algorithm
hey guys i need to implement minimax algorithm to my basic console xox game.any help appreciated.
https://github.com/fcokur/xox
3 Replies
is a school assignment? what are you struggling with?
also, don't use
Convert.ToInt32
right now your app has bugsit s not homework.i am just practicing data structures and algorithms.
yeah its better if i use tryparse
@ZacharyPatten i cant understand how minimax algorithm works at some point
for the minmax algorithm you simulate making all possible moves until an end game state is reached. if the state is a loss you return -1. if it is a win you return 1. You add up all those results into the previous simulated move's score. the move with the highest score is considered the optimal move