{"action":"created","comment":{"url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/comments/39978710","id":39978710,"diff_hunk":"@@ -0,0 +1,52 @@\n+class Game\n+\n+\n+\n+  def computer_play\n+    [:rock,:paper,:scissors].sample\n+  end\n+\n+  def play(player_choice)\n+    @comp = self.computer_play\n+      if player_choice == @comp\n+        :draw\n+      elsif player_win?(player_choice)\n+        :win\n+      elsif player_lose?(player_choice)\n+        :lose\n+      end","path":"lib/game.rb","position":17,"original_position":17,"commit_id":"a68eb877fcbf3c44becbf6372c15767ed23f3568","original_commit_id":"a68eb877fcbf3c44becbf6372c15767ed23f3568","user":{"login":"danldb","id":6850045,"avatar_url":"https://avatars.githubusercontent.com/u/6850045?v=3","gravatar_id":"","url":"https://api.github.com/users/danldb","html_url":"https://github.com/danldb","followers_url":"https://api.github.com/users/danldb/followers","following_url":"https://api.github.com/users/danldb/following{/other_user}","gists_url":"https://api.github.com/users/danldb/gists{/gist_id}","starred_url":"https://api.github.com/users/danldb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danldb/subscriptions","organizations_url":"https://api.github.com/users/danldb/orgs","repos_url":"https://api.github.com/users/danldb/repos","events_url":"https://api.github.com/users/danldb/events{/privacy}","received_events_url":"https://api.github.com/users/danldb/received_events","type":"User","site_admin":false},"body":"### Use of `if/elsif` conditionals for business logic\r\nLong `if` and `elsif` trees are very difficult to read and nested `if` statements require too much working memory for a reader to quickly scan.\r\n\r\nThere are a number of approaches to the game logic of Rock Paper Scissors,  e.g.:\r\n\r\n- Use a hash to map the rules:\r\n```\r\nrules = { rock: scissors,\r\n          paper: :rock,\r\n          scissors: :paper }\r\n```\r\nor for RPSLS:\r\n```\r\nrules = { rock: [scissors, lizard],\r\n          paper: [:rock, :spock],\r\n          scissors: [:paper, :lizard],\r\n          lizard: [:paper, :spock],\r\n          spock: [:rock, :scissors] }\r\n```\r\n- Use individual classes for each weapon (i.e. `Rock`, `Paper` etc.) with a `beats?` or similar method that takes another weapon as a parameter.","created_at":"2015-09-21T14:45:34Z","updated_at":"2015-09-21T14:45:34Z","html_url":"https://github.com/makersacademy/rps-challenge/pull/170#discussion_r39978710","pull_request_url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/170","_links":{"self":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/comments/39978710"},"html":{"href":"https://github.com/makersacademy/rps-challenge/pull/170#discussion_r39978710"},"pull_request":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/170"}}},"pull_request":{"url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/170","id":45521523,"html_url":"https://github.com/makersacademy/rps-challenge/pull/170","diff_url":"https://github.com/makersacademy/rps-challenge/pull/170.diff","patch_url":"https://github.com/makersacademy/rps-challenge/pull/170.patch","issue_url":"https://api.github.com/repos/makersacademy/rps-challenge/issues/170","number":170,"state":"open","locked":false,"title":"Nat's RPS Pull Request v1.0","user":{"login":"nathanielgreen","id":11984722,"avatar_url":"https://avatars.githubusercontent.com/u/11984722?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanielgreen","html_url":"https://github.com/nathanielgreen","followers_url":"https://api.github.com/users/nathanielgreen/followers","following_url":"https://api.github.com/users/nathanielgreen/following{/other_user}","gists_url":"https://api.github.com/users/nathanielgreen/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanielgreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanielgreen/subscriptions","organizations_url":"https://api.github.com/users/nathanielgreen/orgs","repos_url":"https://api.github.com/users/nathanielgreen/repos","events_url":"https://api.github.com/users/nathanielgreen/events{/privacy}","received_events_url":"https://api.github.com/users/nathanielgreen/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-21T07:52:57Z","updated_at":"2015-09-21T14:45:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1677dd752722ca675decb9a42bb81fbf24ffcf63","assignee":{"login":"danldb","id":6850045,"avatar_url":"https://avatars.githubusercontent.com/u/6850045?v=3","gravatar_id":"","url":"https://api.github.com/users/danldb","html_url":"https://github.com/danldb","followers_url":"https://api.github.com/users/danldb/followers","following_url":"https://api.github.com/users/danldb/following{/other_user}","gists_url":"https://api.github.com/users/danldb/gists{/gist_id}","starred_url":"https://api.github.com/users/danldb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danldb/subscriptions","organizations_url":"https://api.github.com/users/danldb/orgs","repos_url":"https://api.github.com/users/danldb/repos","events_url":"https://api.github.com/users/danldb/events{/privacy}","received_events_url":"https://api.github.com/users/danldb/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/170/commits","review_comments_url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/170/comments","review_comment_url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/makersacademy/rps-challenge/issues/170/comments","statuses_url":"https://api.github.com/repos/makersacademy/rps-challenge/statuses/a68eb877fcbf3c44becbf6372c15767ed23f3568","head":{"label":"nathanielgreen:master","ref":"master","sha":"a68eb877fcbf3c44becbf6372c15767ed23f3568","user":{"login":"nathanielgreen","id":11984722,"avatar_url":"https://avatars.githubusercontent.com/u/11984722?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanielgreen","html_url":"https://github.com/nathanielgreen","followers_url":"https://api.github.com/users/nathanielgreen/followers","following_url":"https://api.github.com/users/nathanielgreen/following{/other_user}","gists_url":"https://api.github.com/users/nathanielgreen/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanielgreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanielgreen/subscriptions","organizations_url":"https://api.github.com/users/nathanielgreen/orgs","repos_url":"https://api.github.com/users/nathanielgreen/repos","events_url":"https://api.github.com/users/nathanielgreen/events{/privacy}","received_events_url":"https://api.github.com/users/nathanielgreen/received_events","type":"User","site_admin":false},"repo":{"id":42771233,"name":"rps-challenge","full_name":"nathanielgreen/rps-challenge","owner":{"login":"nathanielgreen","id":11984722,"avatar_url":"https://avatars.githubusercontent.com/u/11984722?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanielgreen","html_url":"https://github.com/nathanielgreen","followers_url":"https://api.github.com/users/nathanielgreen/followers","following_url":"https://api.github.com/users/nathanielgreen/following{/other_user}","gists_url":"https://api.github.com/users/nathanielgreen/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanielgreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanielgreen/subscriptions","organizations_url":"https://api.github.com/users/nathanielgreen/orgs","repos_url":"https://api.github.com/users/nathanielgreen/repos","events_url":"https://api.github.com/users/nathanielgreen/events{/privacy}","received_events_url":"https://api.github.com/users/nathanielgreen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nathanielgreen/rps-challenge","description":"Create the Rock Paper Scissors Game","fork":true,"url":"https://api.github.com/repos/nathanielgreen/rps-challenge","forks_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/forks","keys_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/teams","hooks_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/hooks","issue_events_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/events","assignees_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/tags","blobs_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/languages","stargazers_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/stargazers","contributors_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/contributors","subscribers_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/subscribers","subscription_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/subscription","commits_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/merges","archive_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/downloads","issues_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/labels{/name}","releases_url":"https://api.github.com/repos/nathanielgreen/rps-challenge/releases{/id}","created_at":"2015-09-19T12:02:55Z","updated_at":"2015-09-19T12:02:57Z","pushed_at":"2015-09-21T09:54:47Z","git_url":"git://github.com/nathanielgreen/rps-challenge.git","ssh_url":"git@github.com:nathanielgreen/rps-challenge.git","clone_url":"https://github.com/nathanielgreen/rps-challenge.git","svn_url":"https://github.com/nathanielgreen/rps-challenge","homepage":null,"size":2688,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"makersacademy:master","ref":"master","sha":"cbb82df47ab9b711d20b47c7c9bd12855d465bb1","user":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"repo":{"id":27006066,"name":"rps-challenge","full_name":"makersacademy/rps-challenge","owner":{"login":"makersacademy","id":3636186,"avatar_url":"https://avatars.githubusercontent.com/u/3636186?v=3","gravatar_id":"","url":"https://api.github.com/users/makersacademy","html_url":"https://github.com/makersacademy","followers_url":"https://api.github.com/users/makersacademy/followers","following_url":"https://api.github.com/users/makersacademy/following{/other_user}","gists_url":"https://api.github.com/users/makersacademy/gists{/gist_id}","starred_url":"https://api.github.com/users/makersacademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makersacademy/subscriptions","organizations_url":"https://api.github.com/users/makersacademy/orgs","repos_url":"https://api.github.com/users/makersacademy/repos","events_url":"https://api.github.com/users/makersacademy/events{/privacy}","received_events_url":"https://api.github.com/users/makersacademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/makersacademy/rps-challenge","description":"Create the Rock Paper Scissors Game","fork":false,"url":"https://api.github.com/repos/makersacademy/rps-challenge","forks_url":"https://api.github.com/repos/makersacademy/rps-challenge/forks","keys_url":"https://api.github.com/repos/makersacademy/rps-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/makersacademy/rps-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/makersacademy/rps-challenge/teams","hooks_url":"https://api.github.com/repos/makersacademy/rps-challenge/hooks","issue_events_url":"https://api.github.com/repos/makersacademy/rps-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/makersacademy/rps-challenge/events","assignees_url":"https://api.github.com/repos/makersacademy/rps-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/makersacademy/rps-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/makersacademy/rps-challenge/tags","blobs_url":"https://api.github.com/repos/makersacademy/rps-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/makersacademy/rps-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/makersacademy/rps-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/makersacademy/rps-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/makersacademy/rps-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/makersacademy/rps-challenge/languages","stargazers_url":"https://api.github.com/repos/makersacademy/rps-challenge/stargazers","contributors_url":"https://api.github.com/repos/makersacademy/rps-challenge/contributors","subscribers_url":"https://api.github.com/repos/makersacademy/rps-challenge/subscribers","subscription_url":"https://api.github.com/repos/makersacademy/rps-challenge/subscription","commits_url":"https://api.github.com/repos/makersacademy/rps-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/makersacademy/rps-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/makersacademy/rps-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/makersacademy/rps-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/makersacademy/rps-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/makersacademy/rps-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/makersacademy/rps-challenge/merges","archive_url":"https://api.github.com/repos/makersacademy/rps-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/makersacademy/rps-challenge/downloads","issues_url":"https://api.github.com/repos/makersacademy/rps-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/makersacademy/rps-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/makersacademy/rps-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/makersacademy/rps-challenge/labels{/name}","releases_url":"https://api.github.com/repos/makersacademy/rps-challenge/releases{/id}","created_at":"2014-11-22T17:15:17Z","updated_at":"2015-04-02T19:30:46Z","pushed_at":"2015-09-21T13:30:14Z","git_url":"git://github.com/makersacademy/rps-challenge.git","ssh_url":"git@github.com:makersacademy/rps-challenge.git","clone_url":"https://github.com/makersacademy/rps-challenge.git","svn_url":"https://github.com/makersacademy/rps-challenge","homepage":null,"size":78105,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":172,"mirror_url":null,"open_issues_count":33,"forks":172,"open_issues":33,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/170"},"html":{"href":"https://github.com/makersacademy/rps-challenge/pull/170"},"issue":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/issues/170"},"comments":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/issues/170/comments"},"review_comments":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/170/comments"},"review_comment":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/170/commits"},"statuses":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/statuses/a68eb877fcbf3c44becbf6372c15767ed23f3568"}}}}