I\'m having a huge block trying to understand \"trees\" while making a Tic-Tac-Toe bot. I understand the concept, but I can\'t figure out to implement them.
Can someone
Implementing the Tic Tac Toe game is probably the simplest problem to solve in terms of AI and search space.
The key is to approach the problem with Minimax, Iterative deepening Depth-first search and Alpha-beta pruning algorithms.
Here's my implementation of the game in Python, which is only ~200 lines of code and has the capability to play a game as Human vs. Human
, Human vs. Computer
, and Computer vs. Computer
. It also keeps the statistics on depths and number of nodes reached/pruned leading up to the best move.
I highly recommend edX.org
Artificial Intelligence course, which gives the the fundamental knowledge on current AI topics and solutions.