{"action":"created","comment":{"url":"https://api.github.com/repos/Ada-C6/js-scrabble/pulls/comments/88829500","pull_request_review_id":9389888,"id":88829500,"diff_hunk":"@@ -1,7 +1,117 @@\n-var Scrabble = function() {};\n+// 'use strict';\n+// var prompt = require('prompt');\n+//\n+// prompt.start();\n+\n+// var Scrabble = prompt.get(['word'], function(err, result) {\n+//   this._word = result.word.toUpperCase();\n+// });\n+\n+var letters = {\n+  \"AEIOULNRST\": 1,\n+  \"DG\": 2,\n+  \"BCMP\": 3,\n+  \"FHVWY\": 4,\n+  \"K\": 5,\n+  \"JX\": 8,\n+  \"QZ\": 10\n+};\n+\n+var Scrabble = { //is it possible to initialize this as a constructor? function()\n+\n+};\n+\n+Scrabble.score = function(entry) {\n+  var total = 0;\n+  var word = entry.toUpperCase();\n+  if (word.length == 7) {\n+    total = 50;\n+  }\n+  for (var i = 0; i < word.length; i++) {\n+    for (var group in letters) {\n+      if (group.includes(word[i])) {\n+        total += letters[group];\n+      }\n+    }\n+  }\n+  return total;\n+};\n+\n+Scrabble.highestScoreFrom = function(arrayOfWords) {\n+  var bestScore = 0;\n+  var bestWord = \"\";\n+  arrayOfWords.forEach(function(word) {\n+    if (Scrabble.score(word) > bestScore) {\n+      bestScore = Scrabble.score(word);\n+      bestWord = word;\n+    } else if (Scrabble.score(word) == bestScore) {\n+      if (bestWord.length > word.length && bestWord.length != 7) {\n+        bestWord = word;\n+      } else if (word.length > bestWord.length && word.length == 7) {\n+        bestWord = word;\n+      }","path":"scrabble.js","position":53,"original_position":53,"commit_id":"c65f9c3d7f68bac404b758ee9b5484064745df65","original_commit_id":"c65f9c3d7f68bac404b758ee9b5484064745df65","user":{"login":"CheezItMan","id":1177416,"avatar_url":"https://avatars.githubusercontent.com/u/1177416?v=3","gravatar_id":"","url":"https://api.github.com/users/CheezItMan","html_url":"https://github.com/CheezItMan","followers_url":"https://api.github.com/users/CheezItMan/followers","following_url":"https://api.github.com/users/CheezItMan/following{/other_user}","gists_url":"https://api.github.com/users/CheezItMan/gists{/gist_id}","starred_url":"https://api.github.com/users/CheezItMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CheezItMan/subscriptions","organizations_url":"https://api.github.com/users/CheezItMan/orgs","repos_url":"https://api.github.com/users/CheezItMan/repos","events_url":"https://api.github.com/users/CheezItMan/events{/privacy}","received_events_url":"https://api.github.com/users/CheezItMan/received_events","type":"User","site_admin":false},"body":"I think this series of if/else could be simplified.  Think about it a little. ","created_at":"2016-11-21T04:55:44Z","updated_at":"2016-11-21T04:55:44Z","html_url":"https://github.com/Ada-C6/js-scrabble/pull/24#discussion_r88829500","pull_request_url":"https://api.github.com/repos/Ada-C6/js-scrabble/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/Ada-C6/js-scrabble/pulls/comments/88829500"},"html":{"href":"https://github.com/Ada-C6/js-scrabble/pull/24#discussion_r88829500"},"pull_request":{"href":"https://api.github.com/repos/Ada-C6/js-scrabble/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/Ada-C6/js-scrabble/pulls/24","id":94354974,"html_url":"https://github.com/Ada-C6/js-scrabble/pull/24","diff_url":"https://github.com/Ada-C6/js-scrabble/pull/24.diff","patch_url":"https://github.com/Ada-C6/js-scrabble/pull/24.patch","issue_url":"https://api.github.com/repos/Ada-C6/js-scrabble/issues/24","number":24,"state":"open","locked":false,"title":"Jessica's JS Scrabble","user":{"login":"jchung722","id":17741213,"avatar_url":"https://avatars.githubusercontent.com/u/17741213?v=3","gravatar_id":"","url":"https://api.github.com/users/jchung722","html_url":"https://github.com/jchung722","followers_url":"https://api.github.com/users/jchung722/followers","following_url":"https://api.github.com/users/jchung722/following{/other_user}","gists_url":"https://api.github.com/users/jchung722/gists{/gist_id}","starred_url":"https://api.github.com/users/jchung722/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jchung722/subscriptions","organizations_url":"https://api.github.com/users/jchung722/orgs","repos_url":"https://api.github.com/users/jchung722/repos","events_url":"https://api.github.com/users/jchung722/events{/privacy}","received_events_url":"https://api.github.com/users/jchung722/received_events","type":"User","site_admin":false},"body":"@CheezItMan ","created_at":"2016-11-18T12:38:37Z","updated_at":"2016-11-21T05:00:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"329632af743d1b51b4a0ca79052c5651ef82878e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Ada-C6/js-scrabble/pulls/24/commits","review_comments_url":"https://api.github.com/repos/Ada-C6/js-scrabble/pulls/24/comments","review_comment_url":"https://api.github.com/repos/Ada-C6/js-scrabble/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ada-C6/js-scrabble/issues/24/comments","statuses_url":"https://api.github.com/repos/Ada-C6/js-scrabble/statuses/c65f9c3d7f68bac404b758ee9b5484064745df65","head":{"label":"jchung722:master","ref":"master","sha":"c65f9c3d7f68bac404b758ee9b5484064745df65","user":{"login":"jchung722","id":17741213,"avatar_url":"https://avatars.githubusercontent.com/u/17741213?v=3","gravatar_id":"","url":"https://api.github.com/users/jchung722","html_url":"https://github.com/jchung722","followers_url":"https://api.github.com/users/jchung722/followers","following_url":"https://api.github.com/users/jchung722/following{/other_user}","gists_url":"https://api.github.com/users/jchung722/gists{/gist_id}","starred_url":"https://api.github.com/users/jchung722/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jchung722/subscriptions","organizations_url":"https://api.github.com/users/jchung722/orgs","repos_url":"https://api.github.com/users/jchung722/repos","events_url":"https://api.github.com/users/jchung722/events{/privacy}","received_events_url":"https://api.github.com/users/jchung722/received_events","type":"User","site_admin":false},"repo":{"id":73857667,"name":"js-scrabble","full_name":"jchung722/js-scrabble","owner":{"login":"jchung722","id":17741213,"avatar_url":"https://avatars.githubusercontent.com/u/17741213?v=3","gravatar_id":"","url":"https://api.github.com/users/jchung722","html_url":"https://github.com/jchung722","followers_url":"https://api.github.com/users/jchung722/followers","following_url":"https://api.github.com/users/jchung722/following{/other_user}","gists_url":"https://api.github.com/users/jchung722/gists{/gist_id}","starred_url":"https://api.github.com/users/jchung722/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jchung722/subscriptions","organizations_url":"https://api.github.com/users/jchung722/orgs","repos_url":"https://api.github.com/users/jchung722/repos","events_url":"https://api.github.com/users/jchung722/events{/privacy}","received_events_url":"https://api.github.com/users/jchung722/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jchung722/js-scrabble","description":null,"fork":true,"url":"https://api.github.com/repos/jchung722/js-scrabble","forks_url":"https://api.github.com/repos/jchung722/js-scrabble/forks","keys_url":"https://api.github.com/repos/jchung722/js-scrabble/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jchung722/js-scrabble/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jchung722/js-scrabble/teams","hooks_url":"https://api.github.com/repos/jchung722/js-scrabble/hooks","issue_events_url":"https://api.github.com/repos/jchung722/js-scrabble/issues/events{/number}","events_url":"https://api.github.com/repos/jchung722/js-scrabble/events","assignees_url":"https://api.github.com/repos/jchung722/js-scrabble/assignees{/user}","branches_url":"https://api.github.com/repos/jchung722/js-scrabble/branches{/branch}","tags_url":"https://api.github.com/repos/jchung722/js-scrabble/tags","blobs_url":"https://api.github.com/repos/jchung722/js-scrabble/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jchung722/js-scrabble/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jchung722/js-scrabble/git/refs{/sha}","trees_url":"https://api.github.com/repos/jchung722/js-scrabble/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jchung722/js-scrabble/statuses/{sha}","languages_url":"https://api.github.com/repos/jchung722/js-scrabble/languages","stargazers_url":"https://api.github.com/repos/jchung722/js-scrabble/stargazers","contributors_url":"https://api.github.com/repos/jchung722/js-scrabble/contributors","subscribers_url":"https://api.github.com/repos/jchung722/js-scrabble/subscribers","subscription_url":"https://api.github.com/repos/jchung722/js-scrabble/subscription","commits_url":"https://api.github.com/repos/jchung722/js-scrabble/commits{/sha}","git_commits_url":"https://api.github.com/repos/jchung722/js-scrabble/git/commits{/sha}","comments_url":"https://api.github.com/repos/jchung722/js-scrabble/comments{/number}","issue_comment_url":"https://api.github.com/repos/jchung722/js-scrabble/issues/comments{/number}","contents_url":"https://api.github.com/repos/jchung722/js-scrabble/contents/{+path}","compare_url":"https://api.github.com/repos/jchung722/js-scrabble/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jchung722/js-scrabble/merges","archive_url":"https://api.github.com/repos/jchung722/js-scrabble/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jchung722/js-scrabble/downloads","issues_url":"https://api.github.com/repos/jchung722/js-scrabble/issues{/number}","pulls_url":"https://api.github.com/repos/jchung722/js-scrabble/pulls{/number}","milestones_url":"https://api.github.com/repos/jchung722/js-scrabble/milestones{/number}","notifications_url":"https://api.github.com/repos/jchung722/js-scrabble/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jchung722/js-scrabble/labels{/name}","releases_url":"https://api.github.com/repos/jchung722/js-scrabble/releases{/id}","deployments_url":"https://api.github.com/repos/jchung722/js-scrabble/deployments","created_at":"2016-11-15T21:40:30Z","updated_at":"2016-11-15T21:40:32Z","pushed_at":"2016-11-17T22:32:56Z","git_url":"git://github.com/jchung722/js-scrabble.git","ssh_url":"git@github.com:jchung722/js-scrabble.git","clone_url":"https://github.com/jchung722/js-scrabble.git","svn_url":"https://github.com/jchung722/js-scrabble","homepage":null,"size":13,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Ada-C6:master","ref":"master","sha":"c99a311be6433927044b1950a67bae518ce5a79b","user":{"login":"Ada-C6","id":20429248,"avatar_url":"https://avatars.githubusercontent.com/u/20429248?v=3","gravatar_id":"","url":"https://api.github.com/users/Ada-C6","html_url":"https://github.com/Ada-C6","followers_url":"https://api.github.com/users/Ada-C6/followers","following_url":"https://api.github.com/users/Ada-C6/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C6/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C6/subscriptions","organizations_url":"https://api.github.com/users/Ada-C6/orgs","repos_url":"https://api.github.com/users/Ada-C6/repos","events_url":"https://api.github.com/users/Ada-C6/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C6/received_events","type":"Organization","site_admin":false},"repo":{"id":73735072,"name":"js-scrabble","full_name":"Ada-C6/js-scrabble","owner":{"login":"Ada-C6","id":20429248,"avatar_url":"https://avatars.githubusercontent.com/u/20429248?v=3","gravatar_id":"","url":"https://api.github.com/users/Ada-C6","html_url":"https://github.com/Ada-C6","followers_url":"https://api.github.com/users/Ada-C6/followers","following_url":"https://api.github.com/users/Ada-C6/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C6/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C6/subscriptions","organizations_url":"https://api.github.com/users/Ada-C6/orgs","repos_url":"https://api.github.com/users/Ada-C6/repos","events_url":"https://api.github.com/users/Ada-C6/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C6/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Ada-C6/js-scrabble","description":null,"fork":true,"url":"https://api.github.com/repos/Ada-C6/js-scrabble","forks_url":"https://api.github.com/repos/Ada-C6/js-scrabble/forks","keys_url":"https://api.github.com/repos/Ada-C6/js-scrabble/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ada-C6/js-scrabble/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ada-C6/js-scrabble/teams","hooks_url":"https://api.github.com/repos/Ada-C6/js-scrabble/hooks","issue_events_url":"https://api.github.com/repos/Ada-C6/js-scrabble/issues/events{/number}","events_url":"https://api.github.com/repos/Ada-C6/js-scrabble/events","assignees_url":"https://api.github.com/repos/Ada-C6/js-scrabble/assignees{/user}","branches_url":"https://api.github.com/repos/Ada-C6/js-scrabble/branches{/branch}","tags_url":"https://api.github.com/repos/Ada-C6/js-scrabble/tags","blobs_url":"https://api.github.com/repos/Ada-C6/js-scrabble/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ada-C6/js-scrabble/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ada-C6/js-scrabble/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ada-C6/js-scrabble/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ada-C6/js-scrabble/statuses/{sha}","languages_url":"https://api.github.com/repos/Ada-C6/js-scrabble/languages","stargazers_url":"https://api.github.com/repos/Ada-C6/js-scrabble/stargazers","contributors_url":"https://api.github.com/repos/Ada-C6/js-scrabble/contributors","subscribers_url":"https://api.github.com/repos/Ada-C6/js-scrabble/subscribers","subscription_url":"https://api.github.com/repos/Ada-C6/js-scrabble/subscription","commits_url":"https://api.github.com/repos/Ada-C6/js-scrabble/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ada-C6/js-scrabble/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ada-C6/js-scrabble/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ada-C6/js-scrabble/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ada-C6/js-scrabble/contents/{+path}","compare_url":"https://api.github.com/repos/Ada-C6/js-scrabble/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ada-C6/js-scrabble/merges","archive_url":"https://api.github.com/repos/Ada-C6/js-scrabble/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ada-C6/js-scrabble/downloads","issues_url":"https://api.github.com/repos/Ada-C6/js-scrabble/issues{/number}","pulls_url":"https://api.github.com/repos/Ada-C6/js-scrabble/pulls{/number}","milestones_url":"https://api.github.com/repos/Ada-C6/js-scrabble/milestones{/number}","notifications_url":"https://api.github.com/repos/Ada-C6/js-scrabble/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ada-C6/js-scrabble/labels{/name}","releases_url":"https://api.github.com/repos/Ada-C6/js-scrabble/releases{/id}","deployments_url":"https://api.github.com/repos/Ada-C6/js-scrabble/deployments","created_at":"2016-11-14T18:33:11Z","updated_at":"2016-11-14T18:33:12Z","pushed_at":"2016-11-18T23:31:30Z","git_url":"git://github.com/Ada-C6/js-scrabble.git","ssh_url":"git@github.com:Ada-C6/js-scrabble.git","clone_url":"https://github.com/Ada-C6/js-scrabble.git","svn_url":"https://github.com/Ada-C6/js-scrabble","homepage":null,"size":10,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"open_issues_count":36,"forks":45,"open_issues":36,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ada-C6/js-scrabble/pulls/24"},"html":{"href":"https://github.com/Ada-C6/js-scrabble/pull/24"},"issue":{"href":"https://api.github.com/repos/Ada-C6/js-scrabble/issues/24"},"comments":{"href":"https://api.github.com/repos/Ada-C6/js-scrabble/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/Ada-C6/js-scrabble/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/Ada-C6/js-scrabble/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ada-C6/js-scrabble/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/Ada-C6/js-scrabble/statuses/c65f9c3d7f68bac404b758ee9b5484064745df65"}}}}
{"actor":{"display_login":"CheezItMan"}}