{"action":"closed","issue":{"url":"https://api.github.com/repos/eerlikh/TicTacToeGame/issues/3","labels_url":"https://api.github.com/repos/eerlikh/TicTacToeGame/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/eerlikh/TicTacToeGame/issues/3/comments","events_url":"https://api.github.com/repos/eerlikh/TicTacToeGame/issues/3/events","html_url":"https://github.com/eerlikh/TicTacToeGame/issues/3","id":99525375,"number":3,"title":"Problems alternating turns between players in JS","user":{"login":"eerlikh","id":8581776,"avatar_url":"https://avatars.githubusercontent.com/u/8581776?v=3","gravatar_id":"","url":"https://api.github.com/users/eerlikh","html_url":"https://github.com/eerlikh","followers_url":"https://api.github.com/users/eerlikh/followers","following_url":"https://api.github.com/users/eerlikh/following{/other_user}","gists_url":"https://api.github.com/users/eerlikh/gists{/gist_id}","starred_url":"https://api.github.com/users/eerlikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eerlikh/subscriptions","organizations_url":"https://api.github.com/users/eerlikh/orgs","repos_url":"https://api.github.com/users/eerlikh/repos","events_url":"https://api.github.com/users/eerlikh/events{/privacy}","received_events_url":"https://api.github.com/users/eerlikh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"rapala61","id":863301,"avatar_url":"https://avatars.githubusercontent.com/u/863301?v=3","gravatar_id":"","url":"https://api.github.com/users/rapala61","html_url":"https://github.com/rapala61","followers_url":"https://api.github.com/users/rapala61/followers","following_url":"https://api.github.com/users/rapala61/following{/other_user}","gists_url":"https://api.github.com/users/rapala61/gists{/gist_id}","starred_url":"https://api.github.com/users/rapala61/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapala61/subscriptions","organizations_url":"https://api.github.com/users/rapala61/orgs","repos_url":"https://api.github.com/users/rapala61/repos","events_url":"https://api.github.com/users/rapala61/events{/privacy}","received_events_url":"https://api.github.com/users/rapala61/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-08-06T21:09:55Z","updated_at":"2015-08-07T05:50:37Z","closed_at":"2015-08-07T05:50:37Z","body":"ok ok ok\r\n\r\nSo during my meeting with Andrew I was shown a lot of cool stuff and it was a lot to take in. \r\n\r\n##user story working on - \r\n\r\nAs a player clicks a box on the grid,\r\nI want to be able to show an X or O based on the player,\r\nso I can keep track of who is doing what in the game.\r\n\r\n\r\n##Test Statement -\r\n\r\nclicking on the grid should show and X or an O\r\n\r\n\r\n##Context - here is a jsfiddle for full \r\n\r\nhttp://jsfiddle.net/cu37kLtr/\r\n\r\nwhen i’m trying to do this thing -\r\n\r\n    // if(currentTurn%2==0){\r\n    //        playerOneLogic()\r\n    //        currentTurn++;\r\n    //    } else if(currentTurn%2==1){\r\n    //      alert('two '+ currentTurn)\r\n    //        playerTwoLogic()\r\n    //        currentTurn++;\r\n    //    }\r\n\r\nThe problem is player 2 is always skipped!!!!\r\nI tried changing the conditions for the conditional statement and made sure all my css and html and everything makes sense ><\r\n\r\n\r\n\r\nAlso, Andrew's code works but it's a bit confusing as I have never used the data method yet. I'd need further explanation to manipulate this code snippet successfully. \r\n\r\n $('.box').on('click', function(){\r\n      currentTurn++;\r\n      $(this).data('player', players[ currentTurn%2 ]); // Save data with the node\r\n      $(this).addClass('P-' + players[ currentTurn%2 ]);\r\n\r\n\r\nFor example please explain why blue overwrites red but red can't overwrite blue. why does this function work the way it does??? I need to figure this alternating issue before I proceed to my final step, victory conditions.\r\n\r\n\r\n\r\ni have tried….\r\nwhat triggers the bug.."}}