{"action":"created","comment":{"url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/comments/179561349","pull_request_review_id":109827937,"id":179561349,"diff_hunk":"@@ -0,0 +1,71 @@\n+class Game\n+  attr_accessor :player_1, :player_2, :board\n+  WIN_COMBINATIONS = [[0,1,2], [3,4,5], [6,7,8], [0,3,6],\n+                      [1,4,7], [2,5,8], [0,4,8], [6,4,2]]\n+\n+  def initialize(player_1 = Players::Human.new(\"X\"),\n+    player_2 = Players::Human.new(\"O\"), board = Board.new)\n+    @player_1 = player_1\n+    @player_2 = player_2\n+    @board = board\n+  end\n+\n+  def current_player\n+    board.turn_count % 2 == 0 ? player_1 : player_2\n+  end\n+\n+  def over?\n+    if draw? || won?\n+      true\n+    else\n+      false\n+    end\n+  end\n+\n+  def won?\n+    won = false\n+    cells = self.board.cells\n+    WIN_COMBINATIONS.each do |arr|\n+      if cells[arr[0]] == cells[arr[1]] && cells[arr[1]] == cells[arr[2]]\n+        won = arr unless cells[arr[0]] == \" \"\n+      end\n+    end\n+    won\n+  end\n+\n+  def draw?\n+    if self.board.full? && !self.won?\n+      true\n+    else\n+      false\n+    end\n+  end\n+\n+  def winner\n+    if won?\n+      self.board.cells[won?[0]]\n+    else\n+      nil","path":"lib/game.rb","position":48,"original_position":48,"commit_id":"e54bf58f5eb97d02cf18b1d45e9ac5cf8dedbc29","original_commit_id":"e54bf58f5eb97d02cf18b1d45e9ac5cf8dedbc29","user":{"login":"weezwo","id":19954790,"avatar_url":"https://avatars3.githubusercontent.com/u/19954790?v=4","gravatar_id":"","url":"https://api.github.com/users/weezwo","html_url":"https://github.com/weezwo","followers_url":"https://api.github.com/users/weezwo/followers","following_url":"https://api.github.com/users/weezwo/following{/other_user}","gists_url":"https://api.github.com/users/weezwo/gists{/gist_id}","starred_url":"https://api.github.com/users/weezwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weezwo/subscriptions","organizations_url":"https://api.github.com/users/weezwo/orgs","repos_url":"https://api.github.com/users/weezwo/repos","events_url":"https://api.github.com/users/weezwo/events{/privacy}","received_events_url":"https://api.github.com/users/weezwo/received_events","type":"User","site_admin":false},"body":"You do not need to explicitly return `nil` from an `if` statement; an `if` will return `nil` if the condition fails.\r\n```\r\nif @board.cells[win_combo[0]] != \" \"\r\n  @board.cells[win_combo[0]]\r\nend\r\n```","created_at":"2018-04-05T18:36:46Z","updated_at":"2018-04-05T18:37:38Z","html_url":"https://github.com/learn-co-students/ttt-with-ai-project-v-000/pull/996#discussion_r179561349","pull_request_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/996","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/comments/179561349"},"html":{"href":"https://github.com/learn-co-students/ttt-with-ai-project-v-000/pull/996#discussion_r179561349"},"pull_request":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/996"}}},"pull_request":{"url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/996","id":177521340,"html_url":"https://github.com/learn-co-students/ttt-with-ai-project-v-000/pull/996","diff_url":"https://github.com/learn-co-students/ttt-with-ai-project-v-000/pull/996.diff","patch_url":"https://github.com/learn-co-students/ttt-with-ai-project-v-000/pull/996.patch","issue_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/issues/996","number":996,"state":"open","locked":false,"title":"Done","user":{"login":"AspenJames","id":32749186,"avatar_url":"https://avatars2.githubusercontent.com/u/32749186?v=4","gravatar_id":"","url":"https://api.github.com/users/AspenJames","html_url":"https://github.com/AspenJames","followers_url":"https://api.github.com/users/AspenJames/followers","following_url":"https://api.github.com/users/AspenJames/following{/other_user}","gists_url":"https://api.github.com/users/AspenJames/gists{/gist_id}","starred_url":"https://api.github.com/users/AspenJames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AspenJames/subscriptions","organizations_url":"https://api.github.com/users/AspenJames/orgs","repos_url":"https://api.github.com/users/AspenJames/repos","events_url":"https://api.github.com/users/AspenJames/events{/privacy}","received_events_url":"https://api.github.com/users/AspenJames/received_events","type":"User","site_admin":false},"body":null,"created_at":"2018-03-26T17:55:05Z","updated_at":"2018-04-05T18:37:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c672e3731a48df6a3e93fab29c569d4040d7e113","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/996/commits","review_comments_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/996/comments","review_comment_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/comments{/number}","comments_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/issues/996/comments","statuses_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/statuses/e54bf58f5eb97d02cf18b1d45e9ac5cf8dedbc29","head":{"label":"AspenJames:master","ref":"master","sha":"e54bf58f5eb97d02cf18b1d45e9ac5cf8dedbc29","user":{"login":"AspenJames","id":32749186,"avatar_url":"https://avatars2.githubusercontent.com/u/32749186?v=4","gravatar_id":"","url":"https://api.github.com/users/AspenJames","html_url":"https://github.com/AspenJames","followers_url":"https://api.github.com/users/AspenJames/followers","following_url":"https://api.github.com/users/AspenJames/following{/other_user}","gists_url":"https://api.github.com/users/AspenJames/gists{/gist_id}","starred_url":"https://api.github.com/users/AspenJames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AspenJames/subscriptions","organizations_url":"https://api.github.com/users/AspenJames/orgs","repos_url":"https://api.github.com/users/AspenJames/repos","events_url":"https://api.github.com/users/AspenJames/events{/privacy}","received_events_url":"https://api.github.com/users/AspenJames/received_events","type":"User","site_admin":false},"repo":{"id":126199473,"name":"ttt-with-ai-project-v-000","full_name":"AspenJames/ttt-with-ai-project-v-000","owner":{"login":"AspenJames","id":32749186,"avatar_url":"https://avatars2.githubusercontent.com/u/32749186?v=4","gravatar_id":"","url":"https://api.github.com/users/AspenJames","html_url":"https://github.com/AspenJames","followers_url":"https://api.github.com/users/AspenJames/followers","following_url":"https://api.github.com/users/AspenJames/following{/other_user}","gists_url":"https://api.github.com/users/AspenJames/gists{/gist_id}","starred_url":"https://api.github.com/users/AspenJames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AspenJames/subscriptions","organizations_url":"https://api.github.com/users/AspenJames/orgs","repos_url":"https://api.github.com/users/AspenJames/repos","events_url":"https://api.github.com/users/AspenJames/events{/privacy}","received_events_url":"https://api.github.com/users/AspenJames/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AspenJames/ttt-with-ai-project-v-000","description":null,"fork":true,"url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000","forks_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/forks","keys_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/teams","hooks_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/hooks","issue_events_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/issues/events{/number}","events_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/events","assignees_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/assignees{/user}","branches_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/branches{/branch}","tags_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/tags","blobs_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/git/refs{/sha}","trees_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/statuses/{sha}","languages_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/languages","stargazers_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/stargazers","contributors_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/contributors","subscribers_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/subscribers","subscription_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/subscription","commits_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/commits{/sha}","git_commits_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/git/commits{/sha}","comments_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/comments{/number}","issue_comment_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/issues/comments{/number}","contents_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/contents/{+path}","compare_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/merges","archive_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/downloads","issues_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/issues{/number}","pulls_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/pulls{/number}","milestones_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/milestones{/number}","notifications_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/labels{/name}","releases_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/releases{/id}","deployments_url":"https://api.github.com/repos/AspenJames/ttt-with-ai-project-v-000/deployments","created_at":"2018-03-21T15:23:20Z","updated_at":"2018-03-26T17:55:04Z","pushed_at":"2018-03-26T17:55:03Z","git_url":"git://github.com/AspenJames/ttt-with-ai-project-v-000.git","ssh_url":"git@github.com:AspenJames/ttt-with-ai-project-v-000.git","clone_url":"https://github.com/AspenJames/ttt-with-ai-project-v-000.git","svn_url":"https://github.com/AspenJames/ttt-with-ai-project-v-000","homepage":null,"size":48,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"learn-co-students:master","ref":"master","sha":"6b55f795e3021734fea9f8d5e59dd0806cfae27a","user":{"login":"learn-co-students","id":8825476,"avatar_url":"https://avatars3.githubusercontent.com/u/8825476?v=4","gravatar_id":"","url":"https://api.github.com/users/learn-co-students","html_url":"https://github.com/learn-co-students","followers_url":"https://api.github.com/users/learn-co-students/followers","following_url":"https://api.github.com/users/learn-co-students/following{/other_user}","gists_url":"https://api.github.com/users/learn-co-students/gists{/gist_id}","starred_url":"https://api.github.com/users/learn-co-students/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learn-co-students/subscriptions","organizations_url":"https://api.github.com/users/learn-co-students/orgs","repos_url":"https://api.github.com/users/learn-co-students/repos","events_url":"https://api.github.com/users/learn-co-students/events{/privacy}","received_events_url":"https://api.github.com/users/learn-co-students/received_events","type":"Organization","site_admin":false},"repo":{"id":46080145,"name":"ttt-with-ai-project-v-000","full_name":"learn-co-students/ttt-with-ai-project-v-000","owner":{"login":"learn-co-students","id":8825476,"avatar_url":"https://avatars3.githubusercontent.com/u/8825476?v=4","gravatar_id":"","url":"https://api.github.com/users/learn-co-students","html_url":"https://github.com/learn-co-students","followers_url":"https://api.github.com/users/learn-co-students/followers","following_url":"https://api.github.com/users/learn-co-students/following{/other_user}","gists_url":"https://api.github.com/users/learn-co-students/gists{/gist_id}","starred_url":"https://api.github.com/users/learn-co-students/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learn-co-students/subscriptions","organizations_url":"https://api.github.com/users/learn-co-students/orgs","repos_url":"https://api.github.com/users/learn-co-students/repos","events_url":"https://api.github.com/users/learn-co-students/events{/privacy}","received_events_url":"https://api.github.com/users/learn-co-students/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/learn-co-students/ttt-with-ai-project-v-000","description":null,"fork":false,"url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000","forks_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/forks","keys_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/keys{/key_id}","collaborators_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/teams","hooks_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/hooks","issue_events_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/issues/events{/number}","events_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/events","assignees_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/assignees{/user}","branches_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/branches{/branch}","tags_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/tags","blobs_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/git/refs{/sha}","trees_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/git/trees{/sha}","statuses_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/statuses/{sha}","languages_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/languages","stargazers_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/stargazers","contributors_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/contributors","subscribers_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/subscribers","subscription_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/subscription","commits_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/commits{/sha}","git_commits_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/git/commits{/sha}","comments_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/comments{/number}","issue_comment_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/issues/comments{/number}","contents_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/contents/{+path}","compare_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/compare/{base}...{head}","merges_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/merges","archive_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/downloads","issues_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/issues{/number}","pulls_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls{/number}","milestones_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/milestones{/number}","notifications_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/labels{/name}","releases_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/releases{/id}","deployments_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/deployments","created_at":"2015-11-12T20:52:43Z","updated_at":"2018-01-30T22:03:26Z","pushed_at":"2018-04-05T16:25:10Z","git_url":"git://github.com/learn-co-students/ttt-with-ai-project-v-000.git","ssh_url":"git@github.com:learn-co-students/ttt-with-ai-project-v-000.git","clone_url":"https://github.com/learn-co-students/ttt-with-ai-project-v-000.git","svn_url":"https://github.com/learn-co-students/ttt-with-ai-project-v-000","homepage":null,"size":46,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1008,"mirror_url":null,"archived":false,"open_issues_count":803,"license":null,"forks":1008,"open_issues":803,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/996"},"html":{"href":"https://github.com/learn-co-students/ttt-with-ai-project-v-000/pull/996"},"issue":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/issues/996"},"comments":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/issues/996/comments"},"review_comments":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/996/comments"},"review_comment":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/996/commits"},"statuses":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/statuses/e54bf58f5eb97d02cf18b1d45e9ac5cf8dedbc29"}},"author_association":"NONE"}}
{"actor":{"display_login":"weezwo"}}