Tic Tac Toe in Javascript with AI