{"action":"created","comment":{"url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/comments/36960458","id":36960458,"diff_hunk":"@@ -0,0 +1,62 @@\n+require_relative './player'\n+\n+class Game\n+  attr_reader :p_1, :p_2, :played_matches, :beats\n+\n+  def initialize(p_1, p_2)\n+    @beats = { rock: [:scissors, :lizard],\n+               paper: [:rock, :spock],\n+               scissors: [:paper, :lizard],\n+               spock: [:scissors, :rock],\n+               lizard: [:paper, :spock] }\n+    @p_1 = p_1\n+    @p_2 = p_2\n+    @played_matches = 0\n+  end\n+\n+  def match move_1, move_2\n+    @played_matches += 1\n+    select_moves move_1, move_2\n+    wins_incrementer\n+    match_result\n+    match_winner\n+  end\n+\n+  def select_moves move_1, move_2\n+    p_1.make_move move_1\n+    p_2.name == 'COMPUTER' ? p_2.make_move(random_move) : p_2.make_move(move_2)\n+  end\n+\n+  def random_move\n+    @beats.keys.sample\n+  end\n+\n+  def match_result\n+    if (p_1.move == p_2.move)\n+      0\n+    elsif beats[p_1.move].include?(p_2.move)\n+      1\n+    else\n+      2\n+    end\n+  end\n+\n+  def match_winner\n+    return \"#{p_1.name.capitalize} wins the match\" if match_result == 1","path":"lib/game.rb","position":45,"original_position":45,"commit_id":"d049cdaa21ccf18c524fd05e2a7502be1a14c483","original_commit_id":"d049cdaa21ccf18c524fd05e2a7502be1a14c483","user":{"login":"silvabox","id":3007273,"avatar_url":"https://avatars.githubusercontent.com/u/3007273?v=3","gravatar_id":"","url":"https://api.github.com/users/silvabox","html_url":"https://github.com/silvabox","followers_url":"https://api.github.com/users/silvabox/followers","following_url":"https://api.github.com/users/silvabox/following{/other_user}","gists_url":"https://api.github.com/users/silvabox/gists{/gist_id}","starred_url":"https://api.github.com/users/silvabox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silvabox/subscriptions","organizations_url":"https://api.github.com/users/silvabox/orgs","repos_url":"https://api.github.com/users/silvabox/repos","events_url":"https://api.github.com/users/silvabox/events{/privacy}","received_events_url":"https://api.github.com/users/silvabox/received_events","type":"User","site_admin":false},"body":"you should return the winning player object here and allow the view to decide on the message","created_at":"2015-08-13T10:31:46Z","updated_at":"2015-08-13T10:31:46Z","html_url":"https://github.com/makersacademy/rps-challenge/pull/119#discussion_r36960458","pull_request_url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/119","_links":{"self":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/comments/36960458"},"html":{"href":"https://github.com/makersacademy/rps-challenge/pull/119#discussion_r36960458"},"pull_request":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/119"}}},"pull_request":{"url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/119","id":41977311,"html_url":"https://github.com/makersacademy/rps-challenge/pull/119","diff_url":"https://github.com/makersacademy/rps-challenge/pull/119.diff","patch_url":"https://github.com/makersacademy/rps-challenge/pull/119.patch","issue_url":"https://api.github.com/repos/makersacademy/rps-challenge/issues/119","number":119,"state":"open","locked":false,"title":"submission","user":{"login":"giusepped","id":3399076,"avatar_url":"https://avatars.githubusercontent.com/u/3399076?v=3","gravatar_id":"","url":"https://api.github.com/users/giusepped","html_url":"https://github.com/giusepped","followers_url":"https://api.github.com/users/giusepped/followers","following_url":"https://api.github.com/users/giusepped/following{/other_user}","gists_url":"https://api.github.com/users/giusepped/gists{/gist_id}","starred_url":"https://api.github.com/users/giusepped/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giusepped/subscriptions","organizations_url":"https://api.github.com/users/giusepped/orgs","repos_url":"https://api.github.com/users/giusepped/repos","events_url":"https://api.github.com/users/giusepped/events{/privacy}","received_events_url":"https://api.github.com/users/giusepped/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-09T21:22:35Z","updated_at":"2015-08-13T10:31:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f6275a14d530158232c6221917d1ac6c07c2428","assignee":{"login":"silvabox","id":3007273,"avatar_url":"https://avatars.githubusercontent.com/u/3007273?v=3","gravatar_id":"","url":"https://api.github.com/users/silvabox","html_url":"https://github.com/silvabox","followers_url":"https://api.github.com/users/silvabox/followers","following_url":"https://api.github.com/users/silvabox/following{/other_user}","gists_url":"https://api.github.com/users/silvabox/gists{/gist_id}","starred_url":"https://api.github.com/users/silvabox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silvabox/subscriptions","organizations_url":"https://api.github.com/users/silvabox/orgs","repos_url":"https://api.github.com/users/silvabox/repos","events_url":"https://api.github.com/users/silvabox/events{/privacy}","received_events_url":"https://api.github.com/users/silvabox/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/119/commits","review_comments_url":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/119/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/119/comments","statuses_url":"https://api.github.com/repos/makersacademy/rps-challenge/statuses/d049cdaa21ccf18c524fd05e2a7502be1a14c483","head":{"label":"giusepped:master","ref":"master","sha":"d049cdaa21ccf18c524fd05e2a7502be1a14c483","user":{"login":"giusepped","id":3399076,"avatar_url":"https://avatars.githubusercontent.com/u/3399076?v=3","gravatar_id":"","url":"https://api.github.com/users/giusepped","html_url":"https://github.com/giusepped","followers_url":"https://api.github.com/users/giusepped/followers","following_url":"https://api.github.com/users/giusepped/following{/other_user}","gists_url":"https://api.github.com/users/giusepped/gists{/gist_id}","starred_url":"https://api.github.com/users/giusepped/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giusepped/subscriptions","organizations_url":"https://api.github.com/users/giusepped/orgs","repos_url":"https://api.github.com/users/giusepped/repos","events_url":"https://api.github.com/users/giusepped/events{/privacy}","received_events_url":"https://api.github.com/users/giusepped/received_events","type":"User","site_admin":false},"repo":{"id":40371602,"name":"rps-challenge","full_name":"giusepped/rps-challenge","owner":{"login":"giusepped","id":3399076,"avatar_url":"https://avatars.githubusercontent.com/u/3399076?v=3","gravatar_id":"","url":"https://api.github.com/users/giusepped","html_url":"https://github.com/giusepped","followers_url":"https://api.github.com/users/giusepped/followers","following_url":"https://api.github.com/users/giusepped/following{/other_user}","gists_url":"https://api.github.com/users/giusepped/gists{/gist_id}","starred_url":"https://api.github.com/users/giusepped/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giusepped/subscriptions","organizations_url":"https://api.github.com/users/giusepped/orgs","repos_url":"https://api.github.com/users/giusepped/repos","events_url":"https://api.github.com/users/giusepped/events{/privacy}","received_events_url":"https://api.github.com/users/giusepped/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/giusepped/rps-challenge","description":"Create the Rock Paper Scissors Game","fork":true,"url":"https://api.github.com/repos/giusepped/rps-challenge","forks_url":"https://api.github.com/repos/giusepped/rps-challenge/forks","keys_url":"https://api.github.com/repos/giusepped/rps-challenge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/giusepped/rps-challenge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/giusepped/rps-challenge/teams","hooks_url":"https://api.github.com/repos/giusepped/rps-challenge/hooks","issue_events_url":"https://api.github.com/repos/giusepped/rps-challenge/issues/events{/number}","events_url":"https://api.github.com/repos/giusepped/rps-challenge/events","assignees_url":"https://api.github.com/repos/giusepped/rps-challenge/assignees{/user}","branches_url":"https://api.github.com/repos/giusepped/rps-challenge/branches{/branch}","tags_url":"https://api.github.com/repos/giusepped/rps-challenge/tags","blobs_url":"https://api.github.com/repos/giusepped/rps-challenge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/giusepped/rps-challenge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/giusepped/rps-challenge/git/refs{/sha}","trees_url":"https://api.github.com/repos/giusepped/rps-challenge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/giusepped/rps-challenge/statuses/{sha}","languages_url":"https://api.github.com/repos/giusepped/rps-challenge/languages","stargazers_url":"https://api.github.com/repos/giusepped/rps-challenge/stargazers","contributors_url":"https://api.github.com/repos/giusepped/rps-challenge/contributors","subscribers_url":"https://api.github.com/repos/giusepped/rps-challenge/subscribers","subscription_url":"https://api.github.com/repos/giusepped/rps-challenge/subscription","commits_url":"https://api.github.com/repos/giusepped/rps-challenge/commits{/sha}","git_commits_url":"https://api.github.com/repos/giusepped/rps-challenge/git/commits{/sha}","comments_url":"https://api.github.com/repos/giusepped/rps-challenge/comments{/number}","issue_comment_url":"https://api.github.com/repos/giusepped/rps-challenge/issues/comments{/number}","contents_url":"https://api.github.com/repos/giusepped/rps-challenge/contents/{+path}","compare_url":"https://api.github.com/repos/giusepped/rps-challenge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/giusepped/rps-challenge/merges","archive_url":"https://api.github.com/repos/giusepped/rps-challenge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/giusepped/rps-challenge/downloads","issues_url":"https://api.github.com/repos/giusepped/rps-challenge/issues{/number}","pulls_url":"https://api.github.com/repos/giusepped/rps-challenge/pulls{/number}","milestones_url":"https://api.github.com/repos/giusepped/rps-challenge/milestones{/number}","notifications_url":"https://api.github.com/repos/giusepped/rps-challenge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/giusepped/rps-challenge/labels{/name}","releases_url":"https://api.github.com/repos/giusepped/rps-challenge/releases{/id}","created_at":"2015-08-07T17:07:42Z","updated_at":"2015-08-07T17:07:42Z","pushed_at":"2015-08-09T21:21:38Z","git_url":"git://github.com/giusepped/rps-challenge.git","ssh_url":"git@github.com:giusepped/rps-challenge.git","clone_url":"https://github.com/giusepped/rps-challenge.git","svn_url":"https://github.com/giusepped/rps-challenge","homepage":null,"size":130,"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":"59953a8672f5fdb2f74d149a875340446276117a","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-08-12T17:57:23Z","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":39058,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":133,"mirror_url":null,"open_issues_count":13,"forks":133,"open_issues":13,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/119"},"html":{"href":"https://github.com/makersacademy/rps-challenge/pull/119"},"issue":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/issues/119"},"comments":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/issues/119/comments"},"review_comments":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/pulls/119/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/119/commits"},"statuses":{"href":"https://api.github.com/repos/makersacademy/rps-challenge/statuses/d049cdaa21ccf18c524fd05e2a7502be1a14c483"}}}}