{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/359","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/359/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/359/comments","events_url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/359/events","html_url":"https://github.com/ga-wdi-boston/game-project/issues/359","id":187197509,"number":359,"title":"can't figure out how to end game + display winner + wait to clear board. not sure how to structure game logic.","user":{"login":"kfili","id":22824118,"avatar_url":"https://avatars.githubusercontent.com/u/22824118?v=3","gravatar_id":"","url":"https://api.github.com/users/kfili","html_url":"https://github.com/kfili","followers_url":"https://api.github.com/users/kfili/followers","following_url":"https://api.github.com/users/kfili/following{/other_user}","gists_url":"https://api.github.com/users/kfili/gists{/gist_id}","starred_url":"https://api.github.com/users/kfili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfili/subscriptions","organizations_url":"https://api.github.com/users/kfili/orgs","repos_url":"https://api.github.com/users/kfili/repos","events_url":"https://api.github.com/users/kfili/events{/privacy}","received_events_url":"https://api.github.com/users/kfili/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-03T21:38:53Z","updated_at":"2016-11-03T22:27:44Z","closed_at":null,"body":"I have a game that can fill cells and console.log if its a win, loss, draw. I need to add another layer of complexity to display game results and to provide a game status to send to the back end. (have not started game api yet)\r\n\r\n```js\r\nlet currentState = 'go';\r\n\r\nconst cellclick = function (e) {\r\n  e.preventDefault();\r\n    if (currentState === 'go') {\r\n      if (board[$(this).data('cell')] === '' ) {\r\n          board[$(this).data('cell')] = turn;\r\n          $(this).text(turn);                 // sets X/O to a div\r\n          let currentState = isWin();         // returns 'ended' if win or draw state detected\r\n\r\n\r\n          if (currentState === 'ended') {\r\n            debugger;\r\n              $('#status').text('Player X wins!!');\r\n            } else {\r\n            console.log('this cell is taken, DND!');\r\n            }\r\n          switchTurn();                       // switches a variable that = X or O\r\n          }\r\n    } else if (currentState === 'ended') {\r\n      debugger;\r\n      emptyBoard();                           // clears the board array.\r\n      }\r\n  };\r\n\r\nconst gameHandlers = () => {\r\n  $('.col-xs-4').on('click', cellclick);\r\n  };\r\n```"},"comment":{"url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/comments/258293070","html_url":"https://github.com/ga-wdi-boston/game-project/issues/359#issuecomment-258293070","issue_url":"https://api.github.com/repos/ga-wdi-boston/game-project/issues/359","id":258293070,"user":{"login":"raq929","id":13922520,"avatar_url":"https://avatars.githubusercontent.com/u/13922520?v=3","gravatar_id":"","url":"https://api.github.com/users/raq929","html_url":"https://github.com/raq929","followers_url":"https://api.github.com/users/raq929/followers","following_url":"https://api.github.com/users/raq929/following{/other_user}","gists_url":"https://api.github.com/users/raq929/gists{/gist_id}","starred_url":"https://api.github.com/users/raq929/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raq929/subscriptions","organizations_url":"https://api.github.com/users/raq929/orgs","repos_url":"https://api.github.com/users/raq929/repos","events_url":"https://api.github.com/users/raq929/events{/privacy}","received_events_url":"https://api.github.com/users/raq929/received_events","type":"User","site_admin":false},"created_at":"2016-11-03T22:27:44Z","updated_at":"2016-11-03T22:27:44Z","body":"Sounds good to me!"}}
{"actor":{"display_login":"raq929"}}