Count variable does not reset in javascript when re-initialized
I've encountered an odd situation. I'm building a nice little Tic-Tac-Toe game in JS, and I can't figure out why the count variable will not reset when I init() a second time. The first game works well; the second game count does not reset to 0 even though the var count resets in init(). Game rules: game starts with X and should always start with X. You'll note that the second game starts with O. Would anyone care to take a look? Fiddle: http://jsfiddle.net/1ommcdxg/ var board; var gameBoard; var winners = [ [0,1,2], [3,4,5], [6,7,8], [0,3,6], [1,4,7], [2,5,8], [0,4,8], [2,4,6] ]; var count; v
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.