Cross and Circle game tutorial

HI, Im looking for cross and circle game tutorial where person competes against AI. Tutorial can be in lua or javascript or actionscript… any help would be appreciated!

tic-tac-toe-leisure-game-mental-scribble

EDIT: Sorry this game is actually called tic tac toe, thats why I could’t google anything useful…

Thanks!