Appreciate any constructive feedback on my Tic Tac Toe Project

Appreciate any constructive feedback on my Tic Tac Toe Project
0

#1

Here is the link https://codepen.io/Ajax-2031/pen/rGeJqx to my finished project would appreciate any helpful feedback. Thanks.


#2

Three suggestions:

  1. Don’t use alert to tell the user if they chose X or O. Also, instead of changing the opacity on the mark the player picks, why not change the opacity on the computer’s choice, so it is more evident what the player’s choice is.

  2. Center the characters vertically and horizontally in each square.

  3. Implement some type of winning logic for the computer to make the best move to try and win or at least tie the player.

  4. Don’t reload the page ( using location.reload(true); ) to reset the game. This is unnecessary and forces the browser to refresh the page. All you need to do is create a function which initializes the board and all necessary variables to pre-start values. Then, you would simply call this function when the page loads and use it in the click event for the div with id=“reset”