Sep-03-2020, 05:59 AM
If you want to learn about algorithms for choosing the best move, look at minimax. It's fairly straightforward to understand and it assumes both players choose the best move on their turn. It basically boils down to a depth first search of a tree, where the tree represents the board states that can be reached from the start. Minimax will search that tree unconditionally, meaning some paths will be explored even if that's unnecessary - alpha-beta pruning is an improvement on this.