{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/386","repository_url":"https://api.github.com/repos/ga-wdi-boston/game-project","labels_url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/386/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/386/comments","events_url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/386/events","html_url":"https://github.com/ga-wdi-boston/game-project/issues/386","id":190209104,"number":386,"title":"Still having trouble Resetting the game","user":{"login":"Sphilippe7","id":9563419,"avatar_url":"https://avatars.githubusercontent.com/u/9563419?v=3","gravatar_id":"","url":"https://api.github.com/users/Sphilippe7","html_url":"https://github.com/Sphilippe7","followers_url":"https://api.github.com/users/Sphilippe7/followers","following_url":"https://api.github.com/users/Sphilippe7/following{/other_user}","gists_url":"https://api.github.com/users/Sphilippe7/gists{/gist_id}","starred_url":"https://api.github.com/users/Sphilippe7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sphilippe7/subscriptions","organizations_url":"https://api.github.com/users/Sphilippe7/orgs","repos_url":"https://api.github.com/users/Sphilippe7/repos","events_url":"https://api.github.com/users/Sphilippe7/events{/privacy}","received_events_url":"https://api.github.com/users/Sphilippe7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-18T00:58:04Z","updated_at":"2016-11-18T00:58:55Z","closed_at":null,"body":"So I've been working on this all night but I feel as though I am getting nowhere. The last thing I tried was an example code I got from Google. I'll post my code below.\r\n\r\nMy game logic file:\r\n\r\n```js\r\n'use strict';\r\n\r\nconst api = require('../auth/api');\r\n\r\nlet currentPlayer;\r\nlet count = 1;\r\n\r\n\r\n//Game Board Positioning\r\nlet gameBoardArray = [[\"box\", \"box\", \"box\"],[\"box\", \"box\", \"box\"],[\"box\", \"box\", \"box\"]];\r\n\r\nconst disableGame = function() {\r\n  $(\".tl\").off('click');\r\n  $(\".tm\").off('click');\r\n  $(\".tr\").off('click');\r\n  $(\".ml\").off('click');\r\n  $(\".mm\").off('click');\r\n  $(\".mr\").off('click');\r\n  $(\".bl\").off('click');\r\n  $(\".bm\").off('click');\r\n  $(\".br\").off('click');\r\n};\r\n\r\nconst reset = function() {\r\n  $(\"#reset\").click(function () {\r\n    $(\"#gameBoardArray\").text(\"+\");\r\n\t$(\"box\").removeClass('disable');\r\n\t$(\"box\").removeClass('o');\r\n\t$(\"box\").removeClass('x');\r\n\t$(\"box\").removeClass('btn-primary');\r\n\t$(\"box\").removeClass('btn-info');\r\n\tcount = 0;\r\n\r\n  });\r\n};\r\n\r\n//Winning the game\r\nlet checkforwinner = function() {\r\n  if((gameBoardArray[0][0] === \"x\" && gameBoardArray[0][1] === \"x\" && gameBoardArray[0][2] === \"x\")||\r\n  (gameBoardArray[1][0] === \"x\" && gameBoardArray[1][1] === \"x\" && gameBoardArray[1][2] === \"x\") ||\r\n  (gameBoardArray[2][0] === \"x\" && gameBoardArray[2][1] === \"x\" && gameBoardArray[2][2] === \"x\") ||\r\n  (gameBoardArray[0][0] === \"x\" && gameBoardArray[1][0] === \"x\" && gameBoardArray[2][0] === \"x\") ||\r\n  (gameBoardArray[0][1] === \"x\" && gameBoardArray[1][1] === \"x\" && gameBoardArray[2][1] === \"x\") ||\r\n  (gameBoardArray[0][2] === \"x\" && gameBoardArray[1][2] === \"x\" && gameBoardArray[2][2] === \"x\") ||\r\n\r\n  (gameBoardArray[0][0] === \"x\" && gameBoardArray[1][1] === \"x\" && gameBoardArray[2][2] === \"x\") ||\r\n\r\n  (gameBoardArray[0][2] === \"x\" && gameBoardArray[1][1] === \"x\" && gameBoardArray[2][1] === \"x\")\r\n  )\r\n  {\r\n    $('.display-winner').text('Player 1 Wins!');\r\n    disableGame();\r\n  }\r\n\r\n\r\nif((gameBoardArray[0][0] === \"o\" && gameBoardArray[0][1] === \"o\" && gameBoardArray[0][2] === \"o\") ||\r\n  (gameBoardArray[1][0] === \"o\" && gameBoardArray[1][1] === \"o\" && gameBoardArray[1][2] === \"o\") ||\r\n  (gameBoardArray[2][0] === \"o\" && gameBoardArray[2][1] === \"o\" && gameBoardArray[2][2] === \"o\") ||\r\n  (gameBoardArray[0][0] === \"o\" && gameBoardArray[1][0] === \"o\" && gameBoardArray[2][0] === \"o\") ||\r\n  (gameBoardArray[0][1] === \"o\" && gameBoardArray[1][1] === \"o\" && gameBoardArray[2][1] === \"o\") ||\r\n  (gameBoardArray[0][2] === \"o\" && gameBoardArray[1][2] === \"o\" && gameBoardArray[2][2] === \"o\") ||\r\n  (gameBoardArray[0][0] === \"o\" && gameBoardArray[1][1] === \"o\" && gameBoardArray[2][2] === \"o\") ||\r\n  (gameBoardArray[0][2] === \"o\" && gameBoardArray[1][1] === \"o\" && gameBoardArray[2][1] === \"o\")\r\n  )\r\n  {\r\n  $('.display-winner').text('Player 2 Wins!');\r\n  disableGame();\r\n  }\r\n//if 9 turns have passed and there is no winner then its a tie!\r\nif(count === 9) {\r\n  $('.display-winner').text('Its a Tie!');\r\n  disableGame();\r\n}\r\n};\r\n```js"},"comment":{"url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/comments/261418407","html_url":"https://github.com/ga-wdi-boston/game-project/issues/386#issuecomment-261418407","issue_url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/386","id":261418407,"user":{"login":"Sphilippe7","id":9563419,"avatar_url":"https://avatars.githubusercontent.com/u/9563419?v=3","gravatar_id":"","url":"https://api.github.com/users/Sphilippe7","html_url":"https://github.com/Sphilippe7","followers_url":"https://api.github.com/users/Sphilippe7/followers","following_url":"https://api.github.com/users/Sphilippe7/following{/other_user}","gists_url":"https://api.github.com/users/Sphilippe7/gists{/gist_id}","starred_url":"https://api.github.com/users/Sphilippe7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sphilippe7/subscriptions","organizations_url":"https://api.github.com/users/Sphilippe7/orgs","repos_url":"https://api.github.com/users/Sphilippe7/repos","events_url":"https://api.github.com/users/Sphilippe7/events{/privacy}","received_events_url":"https://api.github.com/users/Sphilippe7/received_events","type":"User","site_admin":false},"created_at":"2016-11-18T00:58:55Z","updated_at":"2016-11-18T00:58:55Z","body":"Part of my API\r\n\r\n```js\r\nconst resetgame = () =>\r\n$.ajax({\r\n  url: api.host + '/games',\r\n  method: 'POST',\r\n  headers: {\r\n    Authorization: 'Token token=' + api.user.token,\r\n  },\r\n});\r\n\r\nmodule.exports = {\r\n  signUp,\r\n  signIn,\r\n  signOut,\r\n  changePassword,\r\n  creategame,\r\n  updategame,\r\n  resetgame\r\n};\r\n```js"}}
{"actor":{"display_login":"Sphilippe7"}}