Update tictactoe.js

Fixed a few bugs