What you want to learn is game theory and data mining. Top programs use a simulation of theoretical games to obtain tolerances for an expert system that is used to randomize a game so that it makes as little systematic errors as possible. If you search the Internet well enough, you will find complete implementations of some of these types of solutions, but often they lack the code that created them. The downside simply makes one of these decisions - it is that they do not make full use of the mistakes of opponents, and that is why most of today's research is directed on this topic.
There are several ways to generate theoretical solutions to the game using almost any conceivable AI algorithm.
Nick larsen
source share