There is still room for improving the Negamax algorithm. Despite its efficiency, the downside of the Negamax algorithm is that it examines more nodes than is necessary (for example, board positions). To overcome this problem, we use Negamax with a search strategy called alpha-beta pruning.
Implementing AB Negamax
Getting ready...
It is important to know the difference between a dynamic member function and a static member function, as well as recursion. A dynamic member function is bound to the instance of the class, while the static member function is bound to the class itself. The static method allows us to call it without instantiating an object. This is great for general-purpose algorithms, such as the ones we'll be...