TicTacToe game in JavaScript with AI