I fixed the positioning of the x's and o's but I still can't figure out how to prevent the x from changing to an o. I tried to put in a statement that would check but either it doesn't work or I am not putting it in the correct place.
if (!$(this).hasClass("o")) || (!$(this).hasClass("x")) {
Excellent work! But you need && instead of || since you want it to take effect only if it does not have an 'x' class *and* it does not have an 'o' class.
ReplyDeleteI've made a derivative version of your tic-tac-toe game here:
http://students.gctaa.net/~jelkner/js/tictactoe/
I wanted to give you a head start toward computing when someone has one the game or it is a tie.
Study this version and write down any questions you have about how it works. Then let's talk about it.