tic tac toe in JavaScript