Coding Hell

Programming and stuff.

Tic-tac-toe AI Part 1: Introduction

One of the things that always interested me is Artificial Intelligence. I never had a chance to learn anything about it, but now the time has come. I recently bought the book Artificial Intelligence: A Modern Approach which I’ll start reading during my flight to the USA.

In this blog series, I’d like to document the development of a simple tic-tac-toe program. Once finished, I’ll release the source code on GitHub.

The program will support three different players:

Human Player: This one is obvious ;)

Simulating AI: A AI simulating all possible moves to find the ones guaranteeing either a win or a tie.

Learning AI: This one is the most interesting one: The only thing it knows is that it plays a turn based game and it can place X’s (or O’s) on a 3x3 grid. It doesn’t know the rules and it doesn’t know any strategies. Instead it will try to win by analyze it’s moves when the game finished.

I’ll use Java (7) as programming language but the principles are useable in any other language as well.