{"action":"created","comment":{"url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/comments/85813189","pull_request_review_id":6505914,"id":85813189,"diff_hunk":"@@ -0,0 +1,105 @@\n+class Game\n+    attr_accessor :board, :player_1, :player_2\n+    WIN_COMBINATIONS = [\n+        [0,1,2],\n+        [3,4,5],\n+        [6,7,8],\n+        [0,3,6],\n+        [1,4,7],\n+        [2,5,8],\n+        [0,4,8],\n+        [6,4,2]\n+    ]\n+\n+    def initialize(play1 = Players::Human.new(\"X\"), play2 = Players::Human.new(\"O\"), board=Board.new)\n+        @board = board\n+        @player_1=play1\n+        @player_2=play2\n+    end\n+\n+    def current_player\n+        if @board.turn_count%2==0\n+            temp = \"X\"\n+        else\n+            temp = \"O\"\n+        end\n+\n+        if temp == player_1.token\n+            player_1\n+        else\n+            player_2\n+        end\n+    end\n+\n+    def won?\n+        WIN_COMBINATIONS.any? do |combo|\n+            x=combo.all? do |index|\n+                @board.cells[index]==\"X\"\n+            end\n+            o=combo.all? do |index|\n+                @board.cells[index]==\"O\"\n+            end\n+            x||o\n+        end\n+    end\n+\n+    def draw?\n+        board.full? && !won?\n+    end\n+\n+    def over?\n+        draw? || won?\n+    end\n+\n+    def winner\n+        temp=WIN_COMBINATIONS.detect do |combo|\n+            x=combo.all? do |index|\n+                @board.cells[index]==\"X\"\n+            end\n+            o=combo.all? do |index|\n+                @board.cells[index]==\"O\"\n+            end\n+            x||o\n+        end\n+        if temp.nil?\n+            nil\n+        else\n+            @board.cells[temp[0]]\n+        end\n+    end\n+\n+\n+    def top","path":"lib/game.rb","position":72,"original_position":72,"commit_id":"38e3dc47e77d851e12d15710da3e9a0182570167","original_commit_id":"38e3dc47e77d851e12d15710da3e9a0182570167","user":{"login":"Lukeghenco","id":15013243,"avatar_url":"https://avatars.githubusercontent.com/u/15013243?v=3","gravatar_id":"","url":"https://api.github.com/users/Lukeghenco","html_url":"https://github.com/Lukeghenco","followers_url":"https://api.github.com/users/Lukeghenco/followers","following_url":"https://api.github.com/users/Lukeghenco/following{/other_user}","gists_url":"https://api.github.com/users/Lukeghenco/gists{/gist_id}","starred_url":"https://api.github.com/users/Lukeghenco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lukeghenco/subscriptions","organizations_url":"https://api.github.com/users/Lukeghenco/orgs","repos_url":"https://api.github.com/users/Lukeghenco/repos","events_url":"https://api.github.com/users/Lukeghenco/events{/privacy}","received_events_url":"https://api.github.com/users/Lukeghenco/received_events","type":"User","site_admin":false},"body":"It is  preferable to see the CLI logic separated from the game logic in its own class (e.g. CLI). Splitting the interface from the implementation of the game allows for multiple interfaces (e.g. a web app) without requiring changes to the game code.","created_at":"2016-10-31T19:21:48Z","updated_at":"2016-10-31T19:22:16Z","html_url":"https://github.com/learn-co-students/ttt-with-ai-project-v-000/pull/326#discussion_r85813189","pull_request_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/326","_links":{"self":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/comments/85813189"},"html":{"href":"https://github.com/learn-co-students/ttt-with-ai-project-v-000/pull/326#discussion_r85813189"},"pull_request":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/326"}}},"pull_request":{"url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/326","id":91556952,"html_url":"https://github.com/learn-co-students/ttt-with-ai-project-v-000/pull/326","diff_url":"https://github.com/learn-co-students/ttt-with-ai-project-v-000/pull/326.diff","patch_url":"https://github.com/learn-co-students/ttt-with-ai-project-v-000/pull/326.patch","issue_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/issues/326","number":326,"state":"open","locked":false,"title":"Done","user":{"login":"mahdiASC","id":22337606,"avatar_url":"https://avatars.githubusercontent.com/u/22337606?v=3","gravatar_id":"","url":"https://api.github.com/users/mahdiASC","html_url":"https://github.com/mahdiASC","followers_url":"https://api.github.com/users/mahdiASC/followers","following_url":"https://api.github.com/users/mahdiASC/following{/other_user}","gists_url":"https://api.github.com/users/mahdiASC/gists{/gist_id}","starred_url":"https://api.github.com/users/mahdiASC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mahdiASC/subscriptions","organizations_url":"https://api.github.com/users/mahdiASC/orgs","repos_url":"https://api.github.com/users/mahdiASC/repos","events_url":"https://api.github.com/users/mahdiASC/events{/privacy}","received_events_url":"https://api.github.com/users/mahdiASC/received_events","type":"User","site_admin":false},"body":null,"created_at":"2016-10-31T04:58:24Z","updated_at":"2016-10-31T19:22:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8171e16298014b2ebb01865e8473d99e6e9a6d6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/326/commits","review_comments_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/326/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/326/comments","statuses_url":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/statuses/38e3dc47e77d851e12d15710da3e9a0182570167","head":{"label":"mahdiASC:master","ref":"master","sha":"38e3dc47e77d851e12d15710da3e9a0182570167","user":{"login":"mahdiASC","id":22337606,"avatar_url":"https://avatars.githubusercontent.com/u/22337606?v=3","gravatar_id":"","url":"https://api.github.com/users/mahdiASC","html_url":"https://github.com/mahdiASC","followers_url":"https://api.github.com/users/mahdiASC/followers","following_url":"https://api.github.com/users/mahdiASC/following{/other_user}","gists_url":"https://api.github.com/users/mahdiASC/gists{/gist_id}","starred_url":"https://api.github.com/users/mahdiASC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mahdiASC/subscriptions","organizations_url":"https://api.github.com/users/mahdiASC/orgs","repos_url":"https://api.github.com/users/mahdiASC/repos","events_url":"https://api.github.com/users/mahdiASC/events{/privacy}","received_events_url":"https://api.github.com/users/mahdiASC/received_events","type":"User","site_admin":false},"repo":{"id":72370147,"name":"ttt-with-ai-project-v-000","full_name":"mahdiASC/ttt-with-ai-project-v-000","owner":{"login":"mahdiASC","id":22337606,"avatar_url":"https://avatars.githubusercontent.com/u/22337606?v=3","gravatar_id":"","url":"https://api.github.com/users/mahdiASC","html_url":"https://github.com/mahdiASC","followers_url":"https://api.github.com/users/mahdiASC/followers","following_url":"https://api.github.com/users/mahdiASC/following{/other_user}","gists_url":"https://api.github.com/users/mahdiASC/gists{/gist_id}","starred_url":"https://api.github.com/users/mahdiASC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mahdiASC/subscriptions","organizations_url":"https://api.github.com/users/mahdiASC/orgs","repos_url":"https://api.github.com/users/mahdiASC/repos","events_url":"https://api.github.com/users/mahdiASC/events{/privacy}","received_events_url":"https://api.github.com/users/mahdiASC/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mahdiASC/ttt-with-ai-project-v-000","description":null,"fork":true,"url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000","forks_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/forks","keys_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/teams","hooks_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/hooks","issue_events_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/issues/events{/number}","events_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/events","assignees_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/assignees{/user}","branches_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/branches{/branch}","tags_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/tags","blobs_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/git/refs{/sha}","trees_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/statuses/{sha}","languages_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/languages","stargazers_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/stargazers","contributors_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/contributors","subscribers_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/subscribers","subscription_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/subscription","commits_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/commits{/sha}","git_commits_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/git/commits{/sha}","comments_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/comments{/number}","issue_comment_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/issues/comments{/number}","contents_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/contents/{+path}","compare_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/merges","archive_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/downloads","issues_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/issues{/number}","pulls_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/pulls{/number}","milestones_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/milestones{/number}","notifications_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/labels{/name}","releases_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/releases{/id}","deployments_url":"https://api.github.com/repos/mahdiASC/ttt-with-ai-project-v-000/deployments","created_at":"2016-10-30T19:21:26Z","updated_at":"2016-10-30T19:21:28Z","pushed_at":"2016-10-31T04:58:12Z","git_url":"git://github.com/mahdiASC/ttt-with-ai-project-v-000.git","ssh_url":"git@github.com:mahdiASC/ttt-with-ai-project-v-000.git","clone_url":"https://github.com/mahdiASC/ttt-with-ai-project-v-000.git","svn_url":"https://github.com/mahdiASC/ttt-with-ai-project-v-000","homepage":null,"size":36,"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":"learn-co-students:master","ref":"master","sha":"5125e4cb97899b63a0cb27351e3a712b15ff8c87","user":{"login":"learn-co-students","id":8825476,"avatar_url":"https://avatars.githubusercontent.com/u/8825476?v=3","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://avatars.githubusercontent.com/u/8825476?v=3","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":"2016-10-10T00:35:29Z","pushed_at":"2016-10-31T04:58:25Z","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":3370,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":339,"mirror_url":null,"open_issues_count":156,"forks":339,"open_issues":156,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/326"},"html":{"href":"https://github.com/learn-co-students/ttt-with-ai-project-v-000/pull/326"},"issue":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/issues/326"},"comments":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/issues/326/comments"},"review_comments":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/pulls/326/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/326/commits"},"statuses":{"href":"https://api.github.com/repos/learn-co-students/ttt-with-ai-project-v-000/statuses/38e3dc47e77d851e12d15710da3e9a0182570167"}}}}
{"actor":{"display_login":"Lukeghenco"}}