{"action":"created","comment":{"url":"https://api.github.com/repos/kkannen/javascript-workbook/pulls/comments/173306114","pull_request_review_id":102476675,"id":173306114,"diff_hunk":"@@ -24,44 +77,89 @@ function Board() {\n         this.grid[row].push(null);\n       }\n     }\n-  };\n-\n-  // prints out the board\n-  this.viewGrid = function() {\n-    // add our column numbers\n+  }\n+  viewGrid() {\n+    // creates grid/gameboard adds numbers\n     let string = \"  0 1 2 3 4 5 6 7\\n\";\n     for (let row = 0; row < 8; row++) {\n-      // we start with our row number in our array\n       const rowOfCheckers = [row];\n-      // a loop within a loop\n       for (let column = 0; column < 8; column++) {\n-        // if the location is \"truthy\" (contains a checker piece, in this case)\n         if (this.grid[row][column]) {\n-          // push the symbol of the check in that location into the array\n           rowOfCheckers.push(this.grid[row][column].symbol);\n         } else {\n-          // just push in a blank space\n           rowOfCheckers.push(' ');\n         }\n       }\n-      // join the rowOfCheckers array to a string, separated by a space\n       string += rowOfCheckers.join(' ');\n-      // add a 'new line'\n       string += \"\\n\";\n     }\n     console.log(string);\n-  };\n+  }\n \n-  // Your code here\n+  startingCheckersToBoard() {\n+    for (let row = 0; row < 8; row++){\n+      if (row === 3 || row === 4){\n+        continue;\n+      }\n+      for (let column = 0; column < 8; column++) {\n+        let color = (row < 3 ? 'red' : 'black');\n+        if (row % 2 === 0 && column % 2 === 1) {\n+          this.grid[row][column] = new Checker(color);\n+          this.checkers.push(new Checker(color))\n+        } else if (row % 2 === 1 && column % 2 === 0) {\n+          this.grid[row][column] = new Checker(color);\n+          this.checkers.push(new Checker(color))\n+        }\n+      }\n+    }\n+  }\n+  pickChecker(row, column) {//picks checker to play\n+    return this.grid[row][column];\n+  }\n+  jumpChecker(jumpedRow , jumpedColumn){/*removes piece from checkers array, removes jumped checker from the board*/\n+    this.checkers.pop();\n+    return this.grid[jumpedRow][jumpedColumn] = null;\n+  }\n }\n-function Game() {\n-\n-  this.board = new Board();\n \n-  this.start = function() {\n+class Game {\n+  constructor() {\n+    this.board = new Board;\n+  }\n+  start() {\n     this.board.createGrid();\n-    // Your code here\n+    this.board.startingCheckersToBoard();\n   };\n+\n+  moveChecker(start, end) {\n+    const checker = this.board.pickChecker(start[0], start[1]);\n+    const endSpace = this.board.grid[end[0]][end[1]];\n+\n+    if (checker) {\n+      if (endSpace) {\n+\n+        console.log('there is already a piece there');\n+      }\n+      else if(endSpace === null) {\n+        if (start[0] - end[0] === 2 || start[0] - end[0] === - 2) {\n+          if(checker.symbol === 'R') {\n+            let jumpedRow = end[0] - 1;","path":"05week/checkers.js","position":169,"original_position":169,"commit_id":"0370bb467f9469282a32f4797df2f0effe018ac7","original_commit_id":"0370bb467f9469282a32f4797df2f0effe018ac7","user":{"login":"reneedudley","id":12837355,"avatar_url":"https://avatars0.githubusercontent.com/u/12837355?v=4","gravatar_id":"","url":"https://api.github.com/users/reneedudley","html_url":"https://github.com/reneedudley","followers_url":"https://api.github.com/users/reneedudley/followers","following_url":"https://api.github.com/users/reneedudley/following{/other_user}","gists_url":"https://api.github.com/users/reneedudley/gists{/gist_id}","starred_url":"https://api.github.com/users/reneedudley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reneedudley/subscriptions","organizations_url":"https://api.github.com/users/reneedudley/orgs","repos_url":"https://api.github.com/users/reneedudley/repos","events_url":"https://api.github.com/users/reneedudley/events{/privacy}","received_events_url":"https://api.github.com/users/reneedudley/received_events","type":"User","site_admin":false},"body":"use const","created_at":"2018-03-08T22:01:25Z","updated_at":"2018-03-08T22:01:55Z","html_url":"https://github.com/kkannen/javascript-workbook/pull/14#discussion_r173306114","pull_request_url":"https://api.github.com/repos/kkannen/javascript-workbook/pulls/14","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/kkannen/javascript-workbook/pulls/comments/173306114"},"html":{"href":"https://github.com/kkannen/javascript-workbook/pull/14#discussion_r173306114"},"pull_request":{"href":"https://api.github.com/repos/kkannen/javascript-workbook/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/kkannen/javascript-workbook/pulls/14","id":173057452,"html_url":"https://github.com/kkannen/javascript-workbook/pull/14","diff_url":"https://github.com/kkannen/javascript-workbook/pull/14.diff","patch_url":"https://github.com/kkannen/javascript-workbook/pull/14.patch","issue_url":"https://api.github.com/repos/kkannen/javascript-workbook/issues/14","number":14,"state":"open","locked":false,"title":"05 week checkers new","user":{"login":"kkannen","id":28993654,"avatar_url":"https://avatars1.githubusercontent.com/u/28993654?v=4","gravatar_id":"","url":"https://api.github.com/users/kkannen","html_url":"https://github.com/kkannen","followers_url":"https://api.github.com/users/kkannen/followers","following_url":"https://api.github.com/users/kkannen/following{/other_user}","gists_url":"https://api.github.com/users/kkannen/gists{/gist_id}","starred_url":"https://api.github.com/users/kkannen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkannen/subscriptions","organizations_url":"https://api.github.com/users/kkannen/orgs","repos_url":"https://api.github.com/users/kkannen/repos","events_url":"https://api.github.com/users/kkannen/events{/privacy}","received_events_url":"https://api.github.com/users/kkannen/received_events","type":"User","site_admin":false},"body":"Here is checkers. It passes all the tests now","created_at":"2018-03-06T04:50:14Z","updated_at":"2018-03-08T22:01:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d43c8e50807a13ec37a81ec803662ed9b11ed67","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kkannen/javascript-workbook/pulls/14/commits","review_comments_url":"https://api.github.com/repos/kkannen/javascript-workbook/pulls/14/comments","review_comment_url":"https://api.github.com/repos/kkannen/javascript-workbook/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kkannen/javascript-workbook/issues/14/comments","statuses_url":"https://api.github.com/repos/kkannen/javascript-workbook/statuses/0370bb467f9469282a32f4797df2f0effe018ac7","head":{"label":"kkannen:05Week-Checkers-New","ref":"05Week-Checkers-New","sha":"0370bb467f9469282a32f4797df2f0effe018ac7","user":{"login":"kkannen","id":28993654,"avatar_url":"https://avatars1.githubusercontent.com/u/28993654?v=4","gravatar_id":"","url":"https://api.github.com/users/kkannen","html_url":"https://github.com/kkannen","followers_url":"https://api.github.com/users/kkannen/followers","following_url":"https://api.github.com/users/kkannen/following{/other_user}","gists_url":"https://api.github.com/users/kkannen/gists{/gist_id}","starred_url":"https://api.github.com/users/kkannen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkannen/subscriptions","organizations_url":"https://api.github.com/users/kkannen/orgs","repos_url":"https://api.github.com/users/kkannen/repos","events_url":"https://api.github.com/users/kkannen/events{/privacy}","received_events_url":"https://api.github.com/users/kkannen/received_events","type":"User","site_admin":false},"repo":{"id":118665705,"name":"javascript-workbook","full_name":"kkannen/javascript-workbook","owner":{"login":"kkannen","id":28993654,"avatar_url":"https://avatars1.githubusercontent.com/u/28993654?v=4","gravatar_id":"","url":"https://api.github.com/users/kkannen","html_url":"https://github.com/kkannen","followers_url":"https://api.github.com/users/kkannen/followers","following_url":"https://api.github.com/users/kkannen/following{/other_user}","gists_url":"https://api.github.com/users/kkannen/gists{/gist_id}","starred_url":"https://api.github.com/users/kkannen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkannen/subscriptions","organizations_url":"https://api.github.com/users/kkannen/orgs","repos_url":"https://api.github.com/users/kkannen/repos","events_url":"https://api.github.com/users/kkannen/events{/privacy}","received_events_url":"https://api.github.com/users/kkannen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kkannen/javascript-workbook","description":"https://austincodingacademy.github.io/javascript-workbook","fork":true,"url":"https://api.github.com/repos/kkannen/javascript-workbook","forks_url":"https://api.github.com/repos/kkannen/javascript-workbook/forks","keys_url":"https://api.github.com/repos/kkannen/javascript-workbook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kkannen/javascript-workbook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kkannen/javascript-workbook/teams","hooks_url":"https://api.github.com/repos/kkannen/javascript-workbook/hooks","issue_events_url":"https://api.github.com/repos/kkannen/javascript-workbook/issues/events{/number}","events_url":"https://api.github.com/repos/kkannen/javascript-workbook/events","assignees_url":"https://api.github.com/repos/kkannen/javascript-workbook/assignees{/user}","branches_url":"https://api.github.com/repos/kkannen/javascript-workbook/branches{/branch}","tags_url":"https://api.github.com/repos/kkannen/javascript-workbook/tags","blobs_url":"https://api.github.com/repos/kkannen/javascript-workbook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kkannen/javascript-workbook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kkannen/javascript-workbook/git/refs{/sha}","trees_url":"https://api.github.com/repos/kkannen/javascript-workbook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kkannen/javascript-workbook/statuses/{sha}","languages_url":"https://api.github.com/repos/kkannen/javascript-workbook/languages","stargazers_url":"https://api.github.com/repos/kkannen/javascript-workbook/stargazers","contributors_url":"https://api.github.com/repos/kkannen/javascript-workbook/contributors","subscribers_url":"https://api.github.com/repos/kkannen/javascript-workbook/subscribers","subscription_url":"https://api.github.com/repos/kkannen/javascript-workbook/subscription","commits_url":"https://api.github.com/repos/kkannen/javascript-workbook/commits{/sha}","git_commits_url":"https://api.github.com/repos/kkannen/javascript-workbook/git/commits{/sha}","comments_url":"https://api.github.com/repos/kkannen/javascript-workbook/comments{/number}","issue_comment_url":"https://api.github.com/repos/kkannen/javascript-workbook/issues/comments{/number}","contents_url":"https://api.github.com/repos/kkannen/javascript-workbook/contents/{+path}","compare_url":"https://api.github.com/repos/kkannen/javascript-workbook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kkannen/javascript-workbook/merges","archive_url":"https://api.github.com/repos/kkannen/javascript-workbook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kkannen/javascript-workbook/downloads","issues_url":"https://api.github.com/repos/kkannen/javascript-workbook/issues{/number}","pulls_url":"https://api.github.com/repos/kkannen/javascript-workbook/pulls{/number}","milestones_url":"https://api.github.com/repos/kkannen/javascript-workbook/milestones{/number}","notifications_url":"https://api.github.com/repos/kkannen/javascript-workbook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kkannen/javascript-workbook/labels{/name}","releases_url":"https://api.github.com/repos/kkannen/javascript-workbook/releases{/id}","deployments_url":"https://api.github.com/repos/kkannen/javascript-workbook/deployments","created_at":"2018-01-23T20:30:54Z","updated_at":"2018-01-23T20:30:55Z","pushed_at":"2018-03-08T19:39:55Z","git_url":"git://github.com/kkannen/javascript-workbook.git","ssh_url":"git@github.com:kkannen/javascript-workbook.git","clone_url":"https://github.com/kkannen/javascript-workbook.git","svn_url":"https://github.com/kkannen/javascript-workbook","homepage":"","size":553,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":0,"open_issues":6,"watchers":0,"default_branch":"gh-pages"}},"base":{"label":"kkannen:gh-pages","ref":"gh-pages","sha":"1acaa26931dd6bf6950c5ec3a7b5adf675dcb614","user":{"login":"kkannen","id":28993654,"avatar_url":"https://avatars1.githubusercontent.com/u/28993654?v=4","gravatar_id":"","url":"https://api.github.com/users/kkannen","html_url":"https://github.com/kkannen","followers_url":"https://api.github.com/users/kkannen/followers","following_url":"https://api.github.com/users/kkannen/following{/other_user}","gists_url":"https://api.github.com/users/kkannen/gists{/gist_id}","starred_url":"https://api.github.com/users/kkannen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkannen/subscriptions","organizations_url":"https://api.github.com/users/kkannen/orgs","repos_url":"https://api.github.com/users/kkannen/repos","events_url":"https://api.github.com/users/kkannen/events{/privacy}","received_events_url":"https://api.github.com/users/kkannen/received_events","type":"User","site_admin":false},"repo":{"id":118665705,"name":"javascript-workbook","full_name":"kkannen/javascript-workbook","owner":{"login":"kkannen","id":28993654,"avatar_url":"https://avatars1.githubusercontent.com/u/28993654?v=4","gravatar_id":"","url":"https://api.github.com/users/kkannen","html_url":"https://github.com/kkannen","followers_url":"https://api.github.com/users/kkannen/followers","following_url":"https://api.github.com/users/kkannen/following{/other_user}","gists_url":"https://api.github.com/users/kkannen/gists{/gist_id}","starred_url":"https://api.github.com/users/kkannen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkannen/subscriptions","organizations_url":"https://api.github.com/users/kkannen/orgs","repos_url":"https://api.github.com/users/kkannen/repos","events_url":"https://api.github.com/users/kkannen/events{/privacy}","received_events_url":"https://api.github.com/users/kkannen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kkannen/javascript-workbook","description":"https://austincodingacademy.github.io/javascript-workbook","fork":true,"url":"https://api.github.com/repos/kkannen/javascript-workbook","forks_url":"https://api.github.com/repos/kkannen/javascript-workbook/forks","keys_url":"https://api.github.com/repos/kkannen/javascript-workbook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kkannen/javascript-workbook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kkannen/javascript-workbook/teams","hooks_url":"https://api.github.com/repos/kkannen/javascript-workbook/hooks","issue_events_url":"https://api.github.com/repos/kkannen/javascript-workbook/issues/events{/number}","events_url":"https://api.github.com/repos/kkannen/javascript-workbook/events","assignees_url":"https://api.github.com/repos/kkannen/javascript-workbook/assignees{/user}","branches_url":"https://api.github.com/repos/kkannen/javascript-workbook/branches{/branch}","tags_url":"https://api.github.com/repos/kkannen/javascript-workbook/tags","blobs_url":"https://api.github.com/repos/kkannen/javascript-workbook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kkannen/javascript-workbook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kkannen/javascript-workbook/git/refs{/sha}","trees_url":"https://api.github.com/repos/kkannen/javascript-workbook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kkannen/javascript-workbook/statuses/{sha}","languages_url":"https://api.github.com/repos/kkannen/javascript-workbook/languages","stargazers_url":"https://api.github.com/repos/kkannen/javascript-workbook/stargazers","contributors_url":"https://api.github.com/repos/kkannen/javascript-workbook/contributors","subscribers_url":"https://api.github.com/repos/kkannen/javascript-workbook/subscribers","subscription_url":"https://api.github.com/repos/kkannen/javascript-workbook/subscription","commits_url":"https://api.github.com/repos/kkannen/javascript-workbook/commits{/sha}","git_commits_url":"https://api.github.com/repos/kkannen/javascript-workbook/git/commits{/sha}","comments_url":"https://api.github.com/repos/kkannen/javascript-workbook/comments{/number}","issue_comment_url":"https://api.github.com/repos/kkannen/javascript-workbook/issues/comments{/number}","contents_url":"https://api.github.com/repos/kkannen/javascript-workbook/contents/{+path}","compare_url":"https://api.github.com/repos/kkannen/javascript-workbook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kkannen/javascript-workbook/merges","archive_url":"https://api.github.com/repos/kkannen/javascript-workbook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kkannen/javascript-workbook/downloads","issues_url":"https://api.github.com/repos/kkannen/javascript-workbook/issues{/number}","pulls_url":"https://api.github.com/repos/kkannen/javascript-workbook/pulls{/number}","milestones_url":"https://api.github.com/repos/kkannen/javascript-workbook/milestones{/number}","notifications_url":"https://api.github.com/repos/kkannen/javascript-workbook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kkannen/javascript-workbook/labels{/name}","releases_url":"https://api.github.com/repos/kkannen/javascript-workbook/releases{/id}","deployments_url":"https://api.github.com/repos/kkannen/javascript-workbook/deployments","created_at":"2018-01-23T20:30:54Z","updated_at":"2018-01-23T20:30:55Z","pushed_at":"2018-03-08T19:39:55Z","git_url":"git://github.com/kkannen/javascript-workbook.git","ssh_url":"git@github.com:kkannen/javascript-workbook.git","clone_url":"https://github.com/kkannen/javascript-workbook.git","svn_url":"https://github.com/kkannen/javascript-workbook","homepage":"","size":553,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":0,"open_issues":6,"watchers":0,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/kkannen/javascript-workbook/pulls/14"},"html":{"href":"https://github.com/kkannen/javascript-workbook/pull/14"},"issue":{"href":"https://api.github.com/repos/kkannen/javascript-workbook/issues/14"},"comments":{"href":"https://api.github.com/repos/kkannen/javascript-workbook/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/kkannen/javascript-workbook/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/kkannen/javascript-workbook/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kkannen/javascript-workbook/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/kkannen/javascript-workbook/statuses/0370bb467f9469282a32f4797df2f0effe018ac7"}},"author_association":"OWNER"}}
{"actor":{"display_login":"reneedudley"}}