My very first tic-tac-toe game I made had a pretty decent AI. In fact the AI could even win sometimes. My last variation of a tic-tac-toe game, dynamic toe (you could play on a grid from 3x3 to 9x9), doesn't have so great of an AI, though. The game was pretty easy for me to make, but it's still a little bit more tricky than you might think.I could dig up the source if you're interested. I played your tic tac toe game today at school, and the computer didn't win once... Not that that should happen, but I shouldn't win every time on my third piece.