public int alphaBeta(node, depth, a, b) 

	if depth == max or (node has no children) 
		return eval(node);
	for each child of the node
		alpha = maximum(alpha, alphaBeta(child, depth - 1, a, b)
		if b <= a
			break; (beta pruned)
	for each child of the node
		beta = minimum(beta, alphaBeta(child, depth - 1, a, b)
		if b<= a
			break; (alpha pruned)
		
	return alpha;

public int eval(boardState)
	return the evaluation of board
	
public static void main
	alphaBeta(root, 0, -infinity, +infinity)