To my knowledge, this site doesn't have any in depth info on creating artificial intelligence for games, such as tictacto, checkers, connect four, etc.
I have used several techniques in the past, & I am looking for a new one that is functional and less cumbersome. The methods I have used include hard coding decisions for various situations, & making random moves when a non-hard coded situation occurs; I have also used strings and lists, particularly for tictacto. This works through different number systems. For instance, in tictacto there are 9 different slots, each of which can be in 1 of 3 different states (X,O, and empty). Therefore, using the base three number system, you could have the calculator string together the collective state of the board, and then find the corresponding element in a list or string which contains a number dictating where the calc should move. Unfortunately, because the numbers in trinary (base 3) get so huge because there are 9 digits total, one cannot simply make a string that has that many characters. It is too huge. Most of these possible combinations aren't used, but because finding a systematic way to only include the used combinations is tricky, usually I end up with several strings, one of which contains all of the recognized situation codes (the 9-digit trinary number which represents the board) and another string which contains the current situation code (9 digit trinary number representing the current state of the entire board) and a third string which contains the corresponding output, or move that should be made under each recognized circumstance. I also put in a feature that can recognize different orientations of the same set up, so:
- - -
- - -
Is treated the same as:
X - -
O - -
X - -
I also know that one could also simply use a system of equations, but I find that oftentimes these equations are extremely hard to write. If any one knows of other techniques I would be interested to hear about them.