----------------------------------- Module Description ----------------------------------- {-WETT The basic idea behind the AI algorithm is that it works with the minimax technique The minimax technique relies on the conceptually simple idea of game trees. A game tree is an expansion of the total state space of a game. Each node of the tree contains the complete description of one state of the game. The minMaxTree function traverses recursively n steps down the game tree and simulates all possible moves within this path down to the bottom. As more moves are possible as longer takes the program execution, that's why I have restricted the traversing to four steps. Suppose I would like to use it to play a game as the first player. Since I am the first player, I'm the maximizing player. The ultimate goal is to find which of the children of the root yields the highest score. To compute this, we consider each of the children individually, and apply the minimax procedure to them one-by-one. However, since we are now on the second level, we must play the part of the minimizing player, whose turn it now is. Therefore, we try to find the node that yields the lowest score. We continue this way down the tree, alternating between maximizing and minimising, until we reach the bottom. The scores are then propagated up through the tree until we get back to the root. Now, the score of each child is known, and we can choose the best move: the greatest if we are the maximizing player, or the least if we are the minimizing. Between each iteration I add the value of the advantage function which calculates the mobility of the player and the pice difference. Furthermore I add to each value the heuristic weight that has been determined experimentally and base on the advantage you gain when you occupy one of the squares. For example corners are very popular because they're secure and cannot be got lost once you've gained them. That's why corners does have a higher weight than all the other squares. Through this concept it is guaranteed that we can make a good decision although we don't traverse through the entire games tree to find the globally best solution. source: http://www.mkorman.org/othello.pdf -}