The most common type of artificial intelligence for this sort of problem is
called a heuristic algorithm. It’s a trick that allows the computer to quickly
come up with a good solution while not guaranteeing a perfect solution. In
general, heuristic algorithms work by assigning a point value to each possible
move and then selecting the best move available.