The Minimax Hub

Alpha-beta Pruning Quiz

Alpha Symbol

Highest value seen so far | Max nodes update alpha

Beta Symbol

Lowest value seen so far | Min nodes update beta

Definition The highest and lowest values seen along the path to that node
Alpha and beta values are only passed down; Terminal values go up
If β ≤ α: Prune
Hint Icon Drag and Drop Prune Icon
            
                function minimax(node, depth, alpha, beta, maximizingPlayer):
                    if depth = 0 or node is a terminal node:
                        return the value of the node
                    if isMaximizingPlayer:
                        bestValue = -infinity
                        for each child of node:
                            val = minimax(child, depth - 1, alpha, beta, False)
                            bestValue = max(bestValue, val)
                            alpha = max(alpha, val)
                            if beta ≤ alpha:
                                break
                        return bestValue
                    else:
                        bestValue = +infinity
                        for each child of node:
                            val = minimax(child, depth - 1, alpha, beta, True)
                            bestValue = min(bestValue, val)
                            beta = min(beta, val)
                            if beta ≤ alpha:
                                break
                        return bestValue

                result = minimax(root, depth, -infinity, +infinity, True)
            
        
Navigation Pointer

Follow the highlighted input

Enter the alpha and beta values

Click Hint Icon if you need help

Drag and drop Drag and Drop Prune Icon to prune

9
8
8
8
5
50
50
7
9
9
2
9
14
14
12
Incorrect Answer Correct Answer
See Your Results
Restart Quiz Navigation