How exactly does minimax recursion work?
So I was looking up Mini-max for a Tic-Tac-Toe Game, but couldn't understand how the recursion worked? Okay, so basically here are my questions: How does minimax know whose turn is it? Whats the best way to indicate the player whose turn it is generating? How do you generate possible moves? How do you know when you are at a terminal node, and how do you generate the terminal nodes? For example in this Pseudo-code function integer minimax(node, depth) if node is a terminal node or depth <= 0: return the heuristic value of node α = -∞ for child in node: # evaluation is identical for both players