Completed minimax algorithm with alpha-beta pruning