The algorithm works as a bounded Depth-First Search (DFS). In each step, the move is chosen by selecting the option that maximizes the player's score and assuming the opponent will choose the option of minimizing it until a terminal (leaf) node is reached.
The move tracking is done using recursion, and the heuristic for selecting or assuming an option depends on the Evaluate function.