Recursion is a technique in which a function calls itself to explore a problem until an exit condition is reached. In Minimax search, each call simulates a possible game move and investigates the resulting future state. section 3.7
A recursive Minimax step typically:
- Checks for a terminal state, such as a win, a full board, or a reached depth limit. section 3.7
- Copies the current game state and applies one possible move. section 3.7
- Calls the algorithm again on the new state with reduced depth and the opposing mode. section 3.7
- Returns the best score and move so earlier calls can compare alternatives. section 3.7
Connect Four game tree
Starting from one board, Minimax explores every valid move, then every response, continuing until a player wins, the board fills, or the search reaches its depth limit. Terminal outcomes receive scores such as 10 for a win, -10 for a loss, and 0 for a draw; those scores move back up the recursive calls. section 3.7
Figure 3.15 Flow of the Minimax search algorithm
Use the Minimax flow to follow the recursive call, terminal-state check, score comparison, and return path. section 3.7






















