{"action":"created","comment":{"url":"https://api.github.com/repos/advanced-js/oop/pulls/comments/45060478","id":45060478,"diff_hunk":"@@ -1 +1,182 @@\n-// var SuperHero = ...\n+// //SOLUTION PART 1\n+\n+// //Create SuperHero class\n+// var SuperHero = function (superName) {\n+// \tthis.superName = superName;\n+// \tthis.hasSecretPower = true;\n+// \tthis.isAlive = true;\n+// \tthis.hasWeapon = true;\n+// \tthis.hasShield = true;\n+// };\n+\n+// //Method using random number generator to determine \n+// //which properties are active on instance of SuperHero\n+// SuperHero.prototype.powerAppraisal = function (){\n+\n+// \tif (parseInt(Math.random() * 5) % 2 === 0) {\n+// \t\tthis.hasSecretPower = false;\n+// \t}\n+\n+// \tif (parseInt(Math.random() * 5) % 2 === 0) {\n+// \t\tthis.hasShield = false;\n+// \t}\n+\n+// \tif (this.hasSecretPower === false && this.hasShield === true) {\n+// \t\treturn \"My weapons will save me\";}\n+\n+// \tif (this.hasShield === false && this.hasSecretPower === false ) {\n+// \t\treturn \"Uh-oh. This is going to be sticky\";}\n+\n+// else if (this.hasSecretPower === true && this.hasShield === true ||\n+//  this.hasSecretPower === true && this.hasShield === false) {\n+// \treturn \"You'll never Harm Me!!\";\n+// }\n+// };\n+\n+// //List of active properties on superPerson instance of SuperHero\n+// var superPerson = new SuperHero('superPerson');\n+// console.log(\"Name: \" + superPerson.superName);\n+// console.log(\"Appraisal of power: \" + superPerson.powerAppraisal());\n+// console.log(\"Secret Power: \" + superPerson.hasSecretPower);\n+// console.log(\"Alive?: \" + superPerson.isAlive);\n+// console.log(\"Has Weapon?: \" + superPerson.hasWeapon);\n+// console.log(\"Has Shield?: \" + superPerson.hasShield);\n+\n+\n+ //---------------------------------------------------------\n+ //SOLUTION PART 2 **** STRINGS REPLACED WITH VARIABLES ****\n+ //---------------------------------------------------------\n+ \n+ //Create SuperHero class\n+ // \"use strict\";\n+ var SuperHero = function (superName) {\n+ \tthis.superName = superName;\n+ \tthis.hasSecretPower = true;\n+ \tthis.isAlive = true;\n+ \tthis.hasWeapon = true;\n+ \tthis.hasShield = true;\n+};\n+\n+function SuperChild(superName) {\n+\tSuperHero.call(this, superName);\n+\tthis.hasBomb = true;\n+}\n+\n+SuperChild.prototype = Object.create(SuperHero.prototype);\n+SuperChild.prototype.constructor = SuperChild;\n+\n+\n+// //Variables substitute for conversation strings as follow:\n+var a = \"My battle skills combined with these weapons will do you in!!\";\n+var b = \"I will fight you with my bare hands!!\";\n+var c = \"With these secret powers you don't have a chance!!\";\n+var d = \"With this shield any weapon you try is just a toy!!\";\n+var e = \"Ha! Your attack is no match for my secret powers!!\";\n+var f = \"GOOD AND EVIL BATTLE TO THE END!!!\";\n+var g = \"EVIL HAS TRIUMPHED -- BUT IT WILL NEVER ENDURE!!\";\n+var h = \"GOOD TRUMPS EVIL AGAIN!!\";\n+var j = \"NOT SO FAST! THIS BOMB IS THE END TO ALL YOUR EVIL\";\n+\n+\n+ \n+ //Method using random number generator to determine \n+ //which properties are active on instance of SuperHero\n+ SuperHero.prototype.attack = function (){\n+ \n+ \tif (Math.round(Math.random() * 18) % 2 === 0) {\n+ \t\tthis.hasSecretPower = false;\n+ \t}\n+ \n+ \telse if (Math.round(Math.random() * 25) % 5 === 0) {\n+ \t\tthis.hasWeapon = false;\n+ \t}\n+\n+ \tif (this.hasBomb === true) {","path":"js/super_hero.js","position":95,"original_position":95,"commit_id":"8bc018688778a01f20abf73097d06f921599f2fc","original_commit_id":"8bc018688778a01f20abf73097d06f921599f2fc","user":{"login":"afeld","id":86842,"avatar_url":"https://avatars.githubusercontent.com/u/86842?v=3","gravatar_id":"","url":"https://api.github.com/users/afeld","html_url":"https://github.com/afeld","followers_url":"https://api.github.com/users/afeld/followers","following_url":"https://api.github.com/users/afeld/following{/other_user}","gists_url":"https://api.github.com/users/afeld/gists{/gist_id}","starred_url":"https://api.github.com/users/afeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afeld/subscriptions","organizations_url":"https://api.github.com/users/afeld/orgs","repos_url":"https://api.github.com/users/afeld/repos","events_url":"https://api.github.com/users/afeld/events{/privacy}","received_events_url":"https://api.github.com/users/afeld/received_events","type":"User","site_admin":false},"body":"Though this is more explicit, you'll more commonly see `if (this.hasBomb)` and `if (!this.hasSecretPower)`, just for conciseness.","created_at":"2015-11-17T13:44:48Z","updated_at":"2015-11-17T13:44:48Z","html_url":"https://github.com/advanced-js/oop/pull/45#discussion_r45060478","pull_request_url":"https://api.github.com/repos/advanced-js/oop/pulls/45","_links":{"self":{"href":"https://api.github.com/repos/advanced-js/oop/pulls/comments/45060478"},"html":{"href":"https://github.com/advanced-js/oop/pull/45#discussion_r45060478"},"pull_request":{"href":"https://api.github.com/repos/advanced-js/oop/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/advanced-js/oop/pulls/45","id":48501582,"html_url":"https://github.com/advanced-js/oop/pull/45","diff_url":"https://github.com/advanced-js/oop/pull/45.diff","patch_url":"https://github.com/advanced-js/oop/pull/45.patch","issue_url":"https://api.github.com/repos/advanced-js/oop/issues/45","number":45,"state":"open","locked":false,"title":"Oop Homework V3","user":{"login":"git-ebetts","id":10982223,"avatar_url":"https://avatars.githubusercontent.com/u/10982223?v=3","gravatar_id":"","url":"https://api.github.com/users/git-ebetts","html_url":"https://github.com/git-ebetts","followers_url":"https://api.github.com/users/git-ebetts/followers","following_url":"https://api.github.com/users/git-ebetts/following{/other_user}","gists_url":"https://api.github.com/users/git-ebetts/gists{/gist_id}","starred_url":"https://api.github.com/users/git-ebetts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/git-ebetts/subscriptions","organizations_url":"https://api.github.com/users/git-ebetts/orgs","repos_url":"https://api.github.com/users/git-ebetts/repos","events_url":"https://api.github.com/users/git-ebetts/events{/privacy}","received_events_url":"https://api.github.com/users/git-ebetts/received_events","type":"User","site_admin":false},"body":"Completed through solution 2. Created tests for Solution 1 (before assignment shifted).","created_at":"2015-10-22T19:29:35Z","updated_at":"2015-11-17T13:44:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c0481cd0f22b1a480bf682b6d3812c80408cc4fd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/advanced-js/oop/pulls/45/commits","review_comments_url":"https://api.github.com/repos/advanced-js/oop/pulls/45/comments","review_comment_url":"https://api.github.com/repos/advanced-js/oop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/advanced-js/oop/issues/45/comments","statuses_url":"https://api.github.com/repos/advanced-js/oop/statuses/8bc018688778a01f20abf73097d06f921599f2fc","head":{"label":"git-ebetts:gh-pages","ref":"gh-pages","sha":"8bc018688778a01f20abf73097d06f921599f2fc","user":{"login":"git-ebetts","id":10982223,"avatar_url":"https://avatars.githubusercontent.com/u/10982223?v=3","gravatar_id":"","url":"https://api.github.com/users/git-ebetts","html_url":"https://github.com/git-ebetts","followers_url":"https://api.github.com/users/git-ebetts/followers","following_url":"https://api.github.com/users/git-ebetts/following{/other_user}","gists_url":"https://api.github.com/users/git-ebetts/gists{/gist_id}","starred_url":"https://api.github.com/users/git-ebetts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/git-ebetts/subscriptions","organizations_url":"https://api.github.com/users/git-ebetts/orgs","repos_url":"https://api.github.com/users/git-ebetts/repos","events_url":"https://api.github.com/users/git-ebetts/events{/privacy}","received_events_url":"https://api.github.com/users/git-ebetts/received_events","type":"User","site_admin":false},"repo":{"id":44767056,"name":"oop","full_name":"git-ebetts/oop","owner":{"login":"git-ebetts","id":10982223,"avatar_url":"https://avatars.githubusercontent.com/u/10982223?v=3","gravatar_id":"","url":"https://api.github.com/users/git-ebetts","html_url":"https://github.com/git-ebetts","followers_url":"https://api.github.com/users/git-ebetts/followers","following_url":"https://api.github.com/users/git-ebetts/following{/other_user}","gists_url":"https://api.github.com/users/git-ebetts/gists{/gist_id}","starred_url":"https://api.github.com/users/git-ebetts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/git-ebetts/subscriptions","organizations_url":"https://api.github.com/users/git-ebetts/orgs","repos_url":"https://api.github.com/users/git-ebetts/repos","events_url":"https://api.github.com/users/git-ebetts/events{/privacy}","received_events_url":"https://api.github.com/users/git-ebetts/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/git-ebetts/oop","description":"Object Oriented Programming exercise","fork":true,"url":"https://api.github.com/repos/git-ebetts/oop","forks_url":"https://api.github.com/repos/git-ebetts/oop/forks","keys_url":"https://api.github.com/repos/git-ebetts/oop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/git-ebetts/oop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/git-ebetts/oop/teams","hooks_url":"https://api.github.com/repos/git-ebetts/oop/hooks","issue_events_url":"https://api.github.com/repos/git-ebetts/oop/issues/events{/number}","events_url":"https://api.github.com/repos/git-ebetts/oop/events","assignees_url":"https://api.github.com/repos/git-ebetts/oop/assignees{/user}","branches_url":"https://api.github.com/repos/git-ebetts/oop/branches{/branch}","tags_url":"https://api.github.com/repos/git-ebetts/oop/tags","blobs_url":"https://api.github.com/repos/git-ebetts/oop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/git-ebetts/oop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/git-ebetts/oop/git/refs{/sha}","trees_url":"https://api.github.com/repos/git-ebetts/oop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/git-ebetts/oop/statuses/{sha}","languages_url":"https://api.github.com/repos/git-ebetts/oop/languages","stargazers_url":"https://api.github.com/repos/git-ebetts/oop/stargazers","contributors_url":"https://api.github.com/repos/git-ebetts/oop/contributors","subscribers_url":"https://api.github.com/repos/git-ebetts/oop/subscribers","subscription_url":"https://api.github.com/repos/git-ebetts/oop/subscription","commits_url":"https://api.github.com/repos/git-ebetts/oop/commits{/sha}","git_commits_url":"https://api.github.com/repos/git-ebetts/oop/git/commits{/sha}","comments_url":"https://api.github.com/repos/git-ebetts/oop/comments{/number}","issue_comment_url":"https://api.github.com/repos/git-ebetts/oop/issues/comments{/number}","contents_url":"https://api.github.com/repos/git-ebetts/oop/contents/{+path}","compare_url":"https://api.github.com/repos/git-ebetts/oop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/git-ebetts/oop/merges","archive_url":"https://api.github.com/repos/git-ebetts/oop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/git-ebetts/oop/downloads","issues_url":"https://api.github.com/repos/git-ebetts/oop/issues{/number}","pulls_url":"https://api.github.com/repos/git-ebetts/oop/pulls{/number}","milestones_url":"https://api.github.com/repos/git-ebetts/oop/milestones{/number}","notifications_url":"https://api.github.com/repos/git-ebetts/oop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/git-ebetts/oop/labels{/name}","releases_url":"https://api.github.com/repos/git-ebetts/oop/releases{/id}","created_at":"2015-10-22T19:03:52Z","updated_at":"2015-10-22T19:03:53Z","pushed_at":"2015-11-09T01:34:29Z","git_url":"git://github.com/git-ebetts/oop.git","ssh_url":"git@github.com:git-ebetts/oop.git","clone_url":"https://github.com/git-ebetts/oop.git","svn_url":"https://github.com/git-ebetts/oop","homepage":null,"size":118,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"gh-pages"}},"base":{"label":"advanced-js:gh-pages","ref":"gh-pages","sha":"31f67317a762ad0602b40ba3eb9e35813f91064c","user":{"login":"advanced-js","id":7143770,"avatar_url":"https://avatars.githubusercontent.com/u/7143770?v=3","gravatar_id":"","url":"https://api.github.com/users/advanced-js","html_url":"https://github.com/advanced-js","followers_url":"https://api.github.com/users/advanced-js/followers","following_url":"https://api.github.com/users/advanced-js/following{/other_user}","gists_url":"https://api.github.com/users/advanced-js/gists{/gist_id}","starred_url":"https://api.github.com/users/advanced-js/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/advanced-js/subscriptions","organizations_url":"https://api.github.com/users/advanced-js/orgs","repos_url":"https://api.github.com/users/advanced-js/repos","events_url":"https://api.github.com/users/advanced-js/events{/privacy}","received_events_url":"https://api.github.com/users/advanced-js/received_events","type":"Organization","site_admin":false},"repo":{"id":18705385,"name":"oop","full_name":"advanced-js/oop","owner":{"login":"advanced-js","id":7143770,"avatar_url":"https://avatars.githubusercontent.com/u/7143770?v=3","gravatar_id":"","url":"https://api.github.com/users/advanced-js","html_url":"https://github.com/advanced-js","followers_url":"https://api.github.com/users/advanced-js/followers","following_url":"https://api.github.com/users/advanced-js/following{/other_user}","gists_url":"https://api.github.com/users/advanced-js/gists{/gist_id}","starred_url":"https://api.github.com/users/advanced-js/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/advanced-js/subscriptions","organizations_url":"https://api.github.com/users/advanced-js/orgs","repos_url":"https://api.github.com/users/advanced-js/repos","events_url":"https://api.github.com/users/advanced-js/events{/privacy}","received_events_url":"https://api.github.com/users/advanced-js/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/advanced-js/oop","description":"Object Oriented Programming exercise","fork":false,"url":"https://api.github.com/repos/advanced-js/oop","forks_url":"https://api.github.com/repos/advanced-js/oop/forks","keys_url":"https://api.github.com/repos/advanced-js/oop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/advanced-js/oop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/advanced-js/oop/teams","hooks_url":"https://api.github.com/repos/advanced-js/oop/hooks","issue_events_url":"https://api.github.com/repos/advanced-js/oop/issues/events{/number}","events_url":"https://api.github.com/repos/advanced-js/oop/events","assignees_url":"https://api.github.com/repos/advanced-js/oop/assignees{/user}","branches_url":"https://api.github.com/repos/advanced-js/oop/branches{/branch}","tags_url":"https://api.github.com/repos/advanced-js/oop/tags","blobs_url":"https://api.github.com/repos/advanced-js/oop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/advanced-js/oop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/advanced-js/oop/git/refs{/sha}","trees_url":"https://api.github.com/repos/advanced-js/oop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/advanced-js/oop/statuses/{sha}","languages_url":"https://api.github.com/repos/advanced-js/oop/languages","stargazers_url":"https://api.github.com/repos/advanced-js/oop/stargazers","contributors_url":"https://api.github.com/repos/advanced-js/oop/contributors","subscribers_url":"https://api.github.com/repos/advanced-js/oop/subscribers","subscription_url":"https://api.github.com/repos/advanced-js/oop/subscription","commits_url":"https://api.github.com/repos/advanced-js/oop/commits{/sha}","git_commits_url":"https://api.github.com/repos/advanced-js/oop/git/commits{/sha}","comments_url":"https://api.github.com/repos/advanced-js/oop/comments{/number}","issue_comment_url":"https://api.github.com/repos/advanced-js/oop/issues/comments{/number}","contents_url":"https://api.github.com/repos/advanced-js/oop/contents/{+path}","compare_url":"https://api.github.com/repos/advanced-js/oop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/advanced-js/oop/merges","archive_url":"https://api.github.com/repos/advanced-js/oop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/advanced-js/oop/downloads","issues_url":"https://api.github.com/repos/advanced-js/oop/issues{/number}","pulls_url":"https://api.github.com/repos/advanced-js/oop/pulls{/number}","milestones_url":"https://api.github.com/repos/advanced-js/oop/milestones{/number}","notifications_url":"https://api.github.com/repos/advanced-js/oop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/advanced-js/oop/labels{/name}","releases_url":"https://api.github.com/repos/advanced-js/oop/releases{/id}","created_at":"2014-04-12T14:03:50Z","updated_at":"2015-08-17T14:31:01Z","pushed_at":"2015-11-09T01:34:29Z","git_url":"git://github.com/advanced-js/oop.git","ssh_url":"git@github.com:advanced-js/oop.git","clone_url":"https://github.com/advanced-js/oop.git","svn_url":"https://github.com/advanced-js/oop","homepage":null,"size":829,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":51,"mirror_url":null,"open_issues_count":8,"forks":51,"open_issues":8,"watchers":3,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/advanced-js/oop/pulls/45"},"html":{"href":"https://github.com/advanced-js/oop/pull/45"},"issue":{"href":"https://api.github.com/repos/advanced-js/oop/issues/45"},"comments":{"href":"https://api.github.com/repos/advanced-js/oop/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/advanced-js/oop/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/advanced-js/oop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/advanced-js/oop/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/advanced-js/oop/statuses/8bc018688778a01f20abf73097d06f921599f2fc"}}}}