{"action":"created","comment":{"url":"https://api.github.com/repos/dForDeveloper/jeopardy/pulls/comments/239587416","pull_request_review_id":182413693,"id":239587416,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTU4NzQxNg==","diff_hunk":"@@ -1,59 +1,97 @@\n-const players = [];\n-const clues = [];\n-const rounds = [];\n-let game;\n+const jeopardy = {\n+  players: [],\n+  clues: [],\n+  rounds: [],\n+  game: {},\n+  categoryNames: {\n+    unitedStatesHistory: 'United States History',\n+    lifeSciences: 'Life Sciences',\n+    publicHealth: 'Public Health',\n+    educationJargon: 'Education Jargon',\n+    nameThatBoardGame: 'Name That Board Game',\n+    americanLiterature: 'American Literature',\n+    biographies: 'Biographies',\n+    americanCities: 'American Cities',\n+    food: 'Food',\n+    cableTV: 'Cable TV'\n+  }\n+};\n \n-$('.input--submit').on('click', createPlayers);\n-$('.main').on('click', presentClue);\n+$('.input--submit').on('click', instantiatePlayers);\n \n function presentClue(event) {\n-  console.log(event.target)\n-  let colRow = event.target.dataset.colrow;\n-  console.log(colRow);\n-  let selectedClue = rounds[0].clues[parseInt(colRow)];\n-  console.log(selectedClue)\n-  alert(selectedClue.question);\n+  const id = event.target.dataset.id;\n+  const selectedClue = jeopardy.rounds[0].clues[parseInt(id)];\n+  if (selectedClue.dailyDouble === true) {\n+    alert('DAILY DOUBLE!\\n' + selectedClue.question);\n+  } else {\n+    alert(selectedClue.question);\n+  }\n+  event.target.innerHTML = '';\n+  jeopardy.game.cluesRemaining--;\n }\n \n-function createPlayers(event) {\n+function instantiatePlayers(event) {\n   event.preventDefault();\n-  players.push(new Player($('#name-0').val()));\n-  players.push(new Player($('#name-1').val()));\n-  players.push(new Player($('#name-2').val()));\n+  jeopardy.players.push(new Player($('#name-0').val()));\n+  jeopardy.players.push(new Player($('#name-1').val()));\n+  jeopardy.players.push(new Player($('#name-2').val()));","path":"js/domUpdates.js","position":56,"original_position":54,"commit_id":"d120d258b479d81a000ad3d22bf3cae596e758a3","original_commit_id":"4e5a1c8c49dbda1134943ef6e92ad40e55077d7d","user":{"login":"AdamN8142","id":40923979,"node_id":"MDQ6VXNlcjQwOTIzOTc5","avatar_url":"https://avatars2.githubusercontent.com/u/40923979?v=4","gravatar_id":"","url":"https://api.github.com/users/AdamN8142","html_url":"https://github.com/AdamN8142","followers_url":"https://api.github.com/users/AdamN8142/followers","following_url":"https://api.github.com/users/AdamN8142/following{/other_user}","gists_url":"https://api.github.com/users/AdamN8142/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamN8142/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamN8142/subscriptions","organizations_url":"https://api.github.com/users/AdamN8142/orgs","repos_url":"https://api.github.com/users/AdamN8142/repos","events_url":"https://api.github.com/users/AdamN8142/events{/privacy}","received_events_url":"https://api.github.com/users/AdamN8142/received_events","type":"User","site_admin":false},"body":"Jeopardy is now our global variable that we can reach into to get our classes instead of setting them  all  as individual  global variables.","created_at":"2018-12-06T19:40:37Z","updated_at":"2018-12-06T19:40:37Z","html_url":"https://github.com/dForDeveloper/jeopardy/pull/10#discussion_r239587416","pull_request_url":"https://api.github.com/repos/dForDeveloper/jeopardy/pulls/10","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/dForDeveloper/jeopardy/pulls/comments/239587416"},"html":{"href":"https://github.com/dForDeveloper/jeopardy/pull/10#discussion_r239587416"},"pull_request":{"href":"https://api.github.com/repos/dForDeveloper/jeopardy/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/dForDeveloper/jeopardy/pulls/10","id":236425676,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2NDI1Njc2","html_url":"https://github.com/dForDeveloper/jeopardy/pull/10","diff_url":"https://github.com/dForDeveloper/jeopardy/pull/10.diff","patch_url":"https://github.com/dForDeveloper/jeopardy/pull/10.patch","issue_url":"https://api.github.com/repos/dForDeveloper/jeopardy/issues/10","number":10,"state":"open","locked":false,"title":"Add random daily doubles, final round, category names, and disappearing squares","user":{"login":"dForDeveloper","id":41239540,"node_id":"MDQ6VXNlcjQxMjM5NTQw","avatar_url":"https://avatars1.githubusercontent.com/u/41239540?v=4","gravatar_id":"","url":"https://api.github.com/users/dForDeveloper","html_url":"https://github.com/dForDeveloper","followers_url":"https://api.github.com/users/dForDeveloper/followers","following_url":"https://api.github.com/users/dForDeveloper/following{/other_user}","gists_url":"https://api.github.com/users/dForDeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/dForDeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dForDeveloper/subscriptions","organizations_url":"https://api.github.com/users/dForDeveloper/orgs","repos_url":"https://api.github.com/users/dForDeveloper/repos","events_url":"https://api.github.com/users/dForDeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/dForDeveloper/received_events","type":"User","site_admin":false},"body":"I finished the randomizeDailyDoubles method in the Round class.  It was simpler to generate a single random number to act as an index than it was to generate two numbers to act as coordinates. This led me to make a setDailyDoubles method which gets called after the clues array is created. This method splices the array and replaces a Clue object with a DailyDouble object instead of checking a conditional that determines whether to instantiate a Clue or a DailyDouble to be pushed into the array as the array is created in the setClues method.\r\n\r\nI then refactored the function that instantiates the Rounds, so that these new methods get called. While I did that, I made sure to write it so that it could instantiate the third round too. Since this function is where the categories are being randomized, I thought it would make sense for it call a function that updated the DOM to reflect the categories, so I added that.\r\n\r\nThen I refactored how the DOM is manipulated when the squares are clicked. Each square's content disappears and cannot be clicked again after the first time. Also if a square contains a daily double, the alert reflects that. There was an error that occurred if the squares were clicked before the player names were entered, and I fixed that as well.\r\n\r\nLastly, I thought we could put the global variables we had into a single object because the project is all about objects.\r\n\r\n@brittanystoroz @thatpamiam @robbiejaeger\r\n","created_at":"2018-12-06T06:53:09Z","updated_at":"2018-12-06T19:40:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4bf75901e2b3e68336944ce64276f265aedc3cdb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dForDeveloper/jeopardy/pulls/10/commits","review_comments_url":"https://api.github.com/repos/dForDeveloper/jeopardy/pulls/10/comments","review_comment_url":"https://api.github.com/repos/dForDeveloper/jeopardy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dForDeveloper/jeopardy/issues/10/comments","statuses_url":"https://api.github.com/repos/dForDeveloper/jeopardy/statuses/d120d258b479d81a000ad3d22bf3cae596e758a3","head":{"label":"dForDeveloper:random-daily-double","ref":"random-daily-double","sha":"d120d258b479d81a000ad3d22bf3cae596e758a3","user":{"login":"dForDeveloper","id":41239540,"node_id":"MDQ6VXNlcjQxMjM5NTQw","avatar_url":"https://avatars1.githubusercontent.com/u/41239540?v=4","gravatar_id":"","url":"https://api.github.com/users/dForDeveloper","html_url":"https://github.com/dForDeveloper","followers_url":"https://api.github.com/users/dForDeveloper/followers","following_url":"https://api.github.com/users/dForDeveloper/following{/other_user}","gists_url":"https://api.github.com/users/dForDeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/dForDeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dForDeveloper/subscriptions","organizations_url":"https://api.github.com/users/dForDeveloper/orgs","repos_url":"https://api.github.com/users/dForDeveloper/repos","events_url":"https://api.github.com/users/dForDeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/dForDeveloper/received_events","type":"User","site_admin":false},"repo":{"id":160546894,"node_id":"MDEwOlJlcG9zaXRvcnkxNjA1NDY4OTQ=","name":"jeopardy","full_name":"dForDeveloper/jeopardy","private":false,"owner":{"login":"dForDeveloper","id":41239540,"node_id":"MDQ6VXNlcjQxMjM5NTQw","avatar_url":"https://avatars1.githubusercontent.com/u/41239540?v=4","gravatar_id":"","url":"https://api.github.com/users/dForDeveloper","html_url":"https://github.com/dForDeveloper","followers_url":"https://api.github.com/users/dForDeveloper/followers","following_url":"https://api.github.com/users/dForDeveloper/following{/other_user}","gists_url":"https://api.github.com/users/dForDeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/dForDeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dForDeveloper/subscriptions","organizations_url":"https://api.github.com/users/dForDeveloper/orgs","repos_url":"https://api.github.com/users/dForDeveloper/repos","events_url":"https://api.github.com/users/dForDeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/dForDeveloper/received_events","type":"User","site_admin":false},"html_url":"https://github.com/dForDeveloper/jeopardy","description":null,"fork":false,"url":"https://api.github.com/repos/dForDeveloper/jeopardy","forks_url":"https://api.github.com/repos/dForDeveloper/jeopardy/forks","keys_url":"https://api.github.com/repos/dForDeveloper/jeopardy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dForDeveloper/jeopardy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dForDeveloper/jeopardy/teams","hooks_url":"https://api.github.com/repos/dForDeveloper/jeopardy/hooks","issue_events_url":"https://api.github.com/repos/dForDeveloper/jeopardy/issues/events{/number}","events_url":"https://api.github.com/repos/dForDeveloper/jeopardy/events","assignees_url":"https://api.github.com/repos/dForDeveloper/jeopardy/assignees{/user}","branches_url":"https://api.github.com/repos/dForDeveloper/jeopardy/branches{/branch}","tags_url":"https://api.github.com/repos/dForDeveloper/jeopardy/tags","blobs_url":"https://api.github.com/repos/dForDeveloper/jeopardy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dForDeveloper/jeopardy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dForDeveloper/jeopardy/git/refs{/sha}","trees_url":"https://api.github.com/repos/dForDeveloper/jeopardy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dForDeveloper/jeopardy/statuses/{sha}","languages_url":"https://api.github.com/repos/dForDeveloper/jeopardy/languages","stargazers_url":"https://api.github.com/repos/dForDeveloper/jeopardy/stargazers","contributors_url":"https://api.github.com/repos/dForDeveloper/jeopardy/contributors","subscribers_url":"https://api.github.com/repos/dForDeveloper/jeopardy/subscribers","subscription_url":"https://api.github.com/repos/dForDeveloper/jeopardy/subscription","commits_url":"https://api.github.com/repos/dForDeveloper/jeopardy/commits{/sha}","git_commits_url":"https://api.github.com/repos/dForDeveloper/jeopardy/git/commits{/sha}","comments_url":"https://api.github.com/repos/dForDeveloper/jeopardy/comments{/number}","issue_comment_url":"https://api.github.com/repos/dForDeveloper/jeopardy/issues/comments{/number}","contents_url":"https://api.github.com/repos/dForDeveloper/jeopardy/contents/{+path}","compare_url":"https://api.github.com/repos/dForDeveloper/jeopardy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dForDeveloper/jeopardy/merges","archive_url":"https://api.github.com/repos/dForDeveloper/jeopardy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dForDeveloper/jeopardy/downloads","issues_url":"https://api.github.com/repos/dForDeveloper/jeopardy/issues{/number}","pulls_url":"https://api.github.com/repos/dForDeveloper/jeopardy/pulls{/number}","milestones_url":"https://api.github.com/repos/dForDeveloper/jeopardy/milestones{/number}","notifications_url":"https://api.github.com/repos/dForDeveloper/jeopardy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dForDeveloper/jeopardy/labels{/name}","releases_url":"https://api.github.com/repos/dForDeveloper/jeopardy/releases{/id}","deployments_url":"https://api.github.com/repos/dForDeveloper/jeopardy/deployments","created_at":"2018-12-05T16:27:19Z","updated_at":"2018-12-06T03:13:13Z","pushed_at":"2018-12-06T07:05:43Z","git_url":"git://github.com/dForDeveloper/jeopardy.git","ssh_url":"git@github.com:dForDeveloper/jeopardy.git","clone_url":"https://github.com/dForDeveloper/jeopardy.git","svn_url":"https://github.com/dForDeveloper/jeopardy","homepage":null,"size":33,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":0,"open_issues":10,"watchers":0,"default_branch":"master"}},"base":{"label":"dForDeveloper:master","ref":"master","sha":"0f56e6b62ece6104b734435aa8a4ec63c20ee909","user":{"login":"dForDeveloper","id":41239540,"node_id":"MDQ6VXNlcjQxMjM5NTQw","avatar_url":"https://avatars1.githubusercontent.com/u/41239540?v=4","gravatar_id":"","url":"https://api.github.com/users/dForDeveloper","html_url":"https://github.com/dForDeveloper","followers_url":"https://api.github.com/users/dForDeveloper/followers","following_url":"https://api.github.com/users/dForDeveloper/following{/other_user}","gists_url":"https://api.github.com/users/dForDeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/dForDeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dForDeveloper/subscriptions","organizations_url":"https://api.github.com/users/dForDeveloper/orgs","repos_url":"https://api.github.com/users/dForDeveloper/repos","events_url":"https://api.github.com/users/dForDeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/dForDeveloper/received_events","type":"User","site_admin":false},"repo":{"id":160546894,"node_id":"MDEwOlJlcG9zaXRvcnkxNjA1NDY4OTQ=","name":"jeopardy","full_name":"dForDeveloper/jeopardy","private":false,"owner":{"login":"dForDeveloper","id":41239540,"node_id":"MDQ6VXNlcjQxMjM5NTQw","avatar_url":"https://avatars1.githubusercontent.com/u/41239540?v=4","gravatar_id":"","url":"https://api.github.com/users/dForDeveloper","html_url":"https://github.com/dForDeveloper","followers_url":"https://api.github.com/users/dForDeveloper/followers","following_url":"https://api.github.com/users/dForDeveloper/following{/other_user}","gists_url":"https://api.github.com/users/dForDeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/dForDeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dForDeveloper/subscriptions","organizations_url":"https://api.github.com/users/dForDeveloper/orgs","repos_url":"https://api.github.com/users/dForDeveloper/repos","events_url":"https://api.github.com/users/dForDeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/dForDeveloper/received_events","type":"User","site_admin":false},"html_url":"https://github.com/dForDeveloper/jeopardy","description":null,"fork":false,"url":"https://api.github.com/repos/dForDeveloper/jeopardy","forks_url":"https://api.github.com/repos/dForDeveloper/jeopardy/forks","keys_url":"https://api.github.com/repos/dForDeveloper/jeopardy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dForDeveloper/jeopardy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dForDeveloper/jeopardy/teams","hooks_url":"https://api.github.com/repos/dForDeveloper/jeopardy/hooks","issue_events_url":"https://api.github.com/repos/dForDeveloper/jeopardy/issues/events{/number}","events_url":"https://api.github.com/repos/dForDeveloper/jeopardy/events","assignees_url":"https://api.github.com/repos/dForDeveloper/jeopardy/assignees{/user}","branches_url":"https://api.github.com/repos/dForDeveloper/jeopardy/branches{/branch}","tags_url":"https://api.github.com/repos/dForDeveloper/jeopardy/tags","blobs_url":"https://api.github.com/repos/dForDeveloper/jeopardy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dForDeveloper/jeopardy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dForDeveloper/jeopardy/git/refs{/sha}","trees_url":"https://api.github.com/repos/dForDeveloper/jeopardy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dForDeveloper/jeopardy/statuses/{sha}","languages_url":"https://api.github.com/repos/dForDeveloper/jeopardy/languages","stargazers_url":"https://api.github.com/repos/dForDeveloper/jeopardy/stargazers","contributors_url":"https://api.github.com/repos/dForDeveloper/jeopardy/contributors","subscribers_url":"https://api.github.com/repos/dForDeveloper/jeopardy/subscribers","subscription_url":"https://api.github.com/repos/dForDeveloper/jeopardy/subscription","commits_url":"https://api.github.com/repos/dForDeveloper/jeopardy/commits{/sha}","git_commits_url":"https://api.github.com/repos/dForDeveloper/jeopardy/git/commits{/sha}","comments_url":"https://api.github.com/repos/dForDeveloper/jeopardy/comments{/number}","issue_comment_url":"https://api.github.com/repos/dForDeveloper/jeopardy/issues/comments{/number}","contents_url":"https://api.github.com/repos/dForDeveloper/jeopardy/contents/{+path}","compare_url":"https://api.github.com/repos/dForDeveloper/jeopardy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dForDeveloper/jeopardy/merges","archive_url":"https://api.github.com/repos/dForDeveloper/jeopardy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dForDeveloper/jeopardy/downloads","issues_url":"https://api.github.com/repos/dForDeveloper/jeopardy/issues{/number}","pulls_url":"https://api.github.com/repos/dForDeveloper/jeopardy/pulls{/number}","milestones_url":"https://api.github.com/repos/dForDeveloper/jeopardy/milestones{/number}","notifications_url":"https://api.github.com/repos/dForDeveloper/jeopardy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dForDeveloper/jeopardy/labels{/name}","releases_url":"https://api.github.com/repos/dForDeveloper/jeopardy/releases{/id}","deployments_url":"https://api.github.com/repos/dForDeveloper/jeopardy/deployments","created_at":"2018-12-05T16:27:19Z","updated_at":"2018-12-06T03:13:13Z","pushed_at":"2018-12-06T07:05:43Z","git_url":"git://github.com/dForDeveloper/jeopardy.git","ssh_url":"git@github.com:dForDeveloper/jeopardy.git","clone_url":"https://github.com/dForDeveloper/jeopardy.git","svn_url":"https://github.com/dForDeveloper/jeopardy","homepage":null,"size":33,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":0,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dForDeveloper/jeopardy/pulls/10"},"html":{"href":"https://github.com/dForDeveloper/jeopardy/pull/10"},"issue":{"href":"https://api.github.com/repos/dForDeveloper/jeopardy/issues/10"},"comments":{"href":"https://api.github.com/repos/dForDeveloper/jeopardy/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/dForDeveloper/jeopardy/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/dForDeveloper/jeopardy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dForDeveloper/jeopardy/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/dForDeveloper/jeopardy/statuses/d120d258b479d81a000ad3d22bf3cae596e758a3"}},"author_association":"OWNER"}}
{"actor":{"display_login":"AdamN8142"}}