Add the minimax algorithm and utility function.