{"action":"created","comment":{"url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/pulls/comments/357642375","pull_request_review_id":331862157,"id":357642375,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM1NzY0MjM3NQ==","diff_hunk":"@@ -9,13 +9,50 @@ def __init__(self, send_message: Callable[[str], None]) -> None:\n         self.game: Optional[TicTacToe] = None\n \n     def handle_message(self, message: str) -> None:\n-        raise NotImplementedError\n+        if message == \"start\":\n+            self.start_game()\n+            return\n+        if self.game:\n+            player, coord_y, coord_x = message.split(' ')\n+            players = {'X': Player.X, 'O': Player.O}\n+            if self.game.can_make_turn(player=players[player], row=int(coord_x), col=int(coord_y)):\n+                self.make_turn(players[player], row=int(coord_x), col=int(coord_y))\n+                return\n+            if not self.game.can_make_turn(player, row=int(coord_x), col=int(coord_y)):\n+                self.send_message(\"Invalid turn\")\n+                return\n+        else:\n+            self.send_message(\"Game is not started\")\n+            return\n \n     def start_game(self) -> None:\n-        raise NotImplementedError\n+        self.game = TicTacToe()\n+        self.send_field()\n \n     def make_turn(self, player: Player, *, row: int, col: int) -> None:\n-        raise NotImplementedError\n+        game_winner = \"\"\n+        self.game.make_turn(player, row=row, col=col)\n+        self.send_field()\n+        if self.game.is_finished():\n+            if self.game.winner() == Player.X:\n+                game_winner = \"X wins\"\n+            if self.game.winner() == Player.O:\n+                game_winner = \"O wins\"\n+            if self.game.winner() is None:\n+                game_winner = \"draw\"\n+            self.send_message(f\"Game is finished, {game_winner}\")\n+            self.game = None\n \n     def send_field(self) -> None:\n-        raise NotImplementedError\n+        field = []","path":"task03-bots/tictactoe_user_handler.py","position":47,"original_position":43,"commit_id":"1a2a3b00f9d2bbb007d279e960fc8d5eceeb5cd6","original_commit_id":"b26938b26d2efa011187a5429f93ccf884c583be","user":{"login":"annikura","id":18505735,"node_id":"MDQ6VXNlcjE4NTA1NzM1","avatar_url":"https://avatars2.githubusercontent.com/u/18505735?v=4","gravatar_id":"","url":"https://api.github.com/users/annikura","html_url":"https://github.com/annikura","followers_url":"https://api.github.com/users/annikura/followers","following_url":"https://api.github.com/users/annikura/following{/other_user}","gists_url":"https://api.github.com/users/annikura/gists{/gist_id}","starred_url":"https://api.github.com/users/annikura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annikura/subscriptions","organizations_url":"https://api.github.com/users/annikura/orgs","repos_url":"https://api.github.com/users/annikura/repos","events_url":"https://api.github.com/users/annikura/events{/privacy}","received_events_url":"https://api.github.com/users/annikura/received_events","type":"User","site_admin":false},"body":"Я ведь просила это генерить не посимвольно. Посмотри, например, тут https://github.com/yeputons/hse-2019-pb-tasks/pull/155/files","created_at":"2019-12-13T13:24:00Z","updated_at":"2019-12-13T13:25:54Z","html_url":"https://github.com/yeputons/hse-2019-pb-tasks/pull/176#discussion_r357642375","pull_request_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/pulls/176","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/pulls/comments/357642375"},"html":{"href":"https://github.com/yeputons/hse-2019-pb-tasks/pull/176#discussion_r357642375"},"pull_request":{"href":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/pulls/176"}}},"pull_request":{"url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/pulls/176","id":347127040,"node_id":"MDExOlB1bGxSZXF1ZXN0MzQ3MTI3MDQw","html_url":"https://github.com/yeputons/hse-2019-pb-tasks/pull/176","diff_url":"https://github.com/yeputons/hse-2019-pb-tasks/pull/176.diff","patch_url":"https://github.com/yeputons/hse-2019-pb-tasks/pull/176.patch","issue_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/issues/176","number":176,"state":"open","locked":false,"title":"Task03-bots, Group02, Широков Кирилл","user":{"login":"shirokov-kirill","id":23099794,"node_id":"MDQ6VXNlcjIzMDk5Nzk0","avatar_url":"https://avatars0.githubusercontent.com/u/23099794?v=4","gravatar_id":"","url":"https://api.github.com/users/shirokov-kirill","html_url":"https://github.com/shirokov-kirill","followers_url":"https://api.github.com/users/shirokov-kirill/followers","following_url":"https://api.github.com/users/shirokov-kirill/following{/other_user}","gists_url":"https://api.github.com/users/shirokov-kirill/gists{/gist_id}","starred_url":"https://api.github.com/users/shirokov-kirill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shirokov-kirill/subscriptions","organizations_url":"https://api.github.com/users/shirokov-kirill/orgs","repos_url":"https://api.github.com/users/shirokov-kirill/repos","events_url":"https://api.github.com/users/shirokov-kirill/events{/privacy}","received_events_url":"https://api.github.com/users/shirokov-kirill/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-11-29T17:43:53Z","updated_at":"2019-12-13T13:25:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"51475a7137a0883ff104f43c4d259d36310090da","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1686381379,"node_id":"MDU6TGFiZWwxNjg2MzgxMzc5","url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/labels/group02","name":"group02","color":"44dd93","default":false,"description":""},{"id":1681356836,"node_id":"MDU6TGFiZWwxNjgxMzU2ODM2","url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/labels/need-grading","name":"need-grading","color":"4830a0","default":false,"description":""},{"id":1698685831,"node_id":"MDU6TGFiZWwxNjk4Njg1ODMx","url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/labels/task03","name":"task03","color":"ef70cf","default":false,"description":""}],"milestone":null,"commits_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/pulls/176/commits","review_comments_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/pulls/176/comments","review_comment_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/issues/176/comments","statuses_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/statuses/1a2a3b00f9d2bbb007d279e960fc8d5eceeb5cd6","head":{"label":"shirokov-kirill:task03-bots-solution","ref":"task03-bots-solution","sha":"1a2a3b00f9d2bbb007d279e960fc8d5eceeb5cd6","user":{"login":"shirokov-kirill","id":23099794,"node_id":"MDQ6VXNlcjIzMDk5Nzk0","avatar_url":"https://avatars0.githubusercontent.com/u/23099794?v=4","gravatar_id":"","url":"https://api.github.com/users/shirokov-kirill","html_url":"https://github.com/shirokov-kirill","followers_url":"https://api.github.com/users/shirokov-kirill/followers","following_url":"https://api.github.com/users/shirokov-kirill/following{/other_user}","gists_url":"https://api.github.com/users/shirokov-kirill/gists{/gist_id}","starred_url":"https://api.github.com/users/shirokov-kirill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shirokov-kirill/subscriptions","organizations_url":"https://api.github.com/users/shirokov-kirill/orgs","repos_url":"https://api.github.com/users/shirokov-kirill/repos","events_url":"https://api.github.com/users/shirokov-kirill/events{/privacy}","received_events_url":"https://api.github.com/users/shirokov-kirill/received_events","type":"User","site_admin":false},"repo":{"id":223380456,"node_id":"MDEwOlJlcG9zaXRvcnkyMjMzODA0NTY=","name":"hse-2019-pb-tasks","full_name":"shirokov-kirill/hse-2019-pb-tasks","private":false,"owner":{"login":"shirokov-kirill","id":23099794,"node_id":"MDQ6VXNlcjIzMDk5Nzk0","avatar_url":"https://avatars0.githubusercontent.com/u/23099794?v=4","gravatar_id":"","url":"https://api.github.com/users/shirokov-kirill","html_url":"https://github.com/shirokov-kirill","followers_url":"https://api.github.com/users/shirokov-kirill/followers","following_url":"https://api.github.com/users/shirokov-kirill/following{/other_user}","gists_url":"https://api.github.com/users/shirokov-kirill/gists{/gist_id}","starred_url":"https://api.github.com/users/shirokov-kirill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shirokov-kirill/subscriptions","organizations_url":"https://api.github.com/users/shirokov-kirill/orgs","repos_url":"https://api.github.com/users/shirokov-kirill/repos","events_url":"https://api.github.com/users/shirokov-kirill/events{/privacy}","received_events_url":"https://api.github.com/users/shirokov-kirill/received_events","type":"User","site_admin":false},"html_url":"https://github.com/shirokov-kirill/hse-2019-pb-tasks","description":null,"fork":true,"url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks","forks_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/forks","keys_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/teams","hooks_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/hooks","issue_events_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/events","assignees_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/tags","blobs_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/languages","stargazers_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/stargazers","contributors_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/contributors","subscribers_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/subscribers","subscription_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/subscription","commits_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/merges","archive_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/downloads","issues_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/labels{/name}","releases_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/releases{/id}","deployments_url":"https://api.github.com/repos/shirokov-kirill/hse-2019-pb-tasks/deployments","created_at":"2019-11-22T10:29:56Z","updated_at":"2019-11-30T18:27:28Z","pushed_at":"2019-12-13T13:21:29Z","git_url":"git://github.com/shirokov-kirill/hse-2019-pb-tasks.git","ssh_url":"git@github.com:shirokov-kirill/hse-2019-pb-tasks.git","clone_url":"https://github.com/shirokov-kirill/hse-2019-pb-tasks.git","svn_url":"https://github.com/shirokov-kirill/hse-2019-pb-tasks","homepage":null,"size":121,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"yeputons:master","ref":"master","sha":"d6164987e0006325cc613818ef217fe49e39be5f","user":{"login":"yeputons","id":1297325,"node_id":"MDQ6VXNlcjEyOTczMjU=","avatar_url":"https://avatars2.githubusercontent.com/u/1297325?v=4","gravatar_id":"","url":"https://api.github.com/users/yeputons","html_url":"https://github.com/yeputons","followers_url":"https://api.github.com/users/yeputons/followers","following_url":"https://api.github.com/users/yeputons/following{/other_user}","gists_url":"https://api.github.com/users/yeputons/gists{/gist_id}","starred_url":"https://api.github.com/users/yeputons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yeputons/subscriptions","organizations_url":"https://api.github.com/users/yeputons/orgs","repos_url":"https://api.github.com/users/yeputons/repos","events_url":"https://api.github.com/users/yeputons/events{/privacy}","received_events_url":"https://api.github.com/users/yeputons/received_events","type":"User","site_admin":false},"repo":{"id":220148111,"node_id":"MDEwOlJlcG9zaXRvcnkyMjAxNDgxMTE=","name":"hse-2019-pb-tasks","full_name":"yeputons/hse-2019-pb-tasks","private":false,"owner":{"login":"yeputons","id":1297325,"node_id":"MDQ6VXNlcjEyOTczMjU=","avatar_url":"https://avatars2.githubusercontent.com/u/1297325?v=4","gravatar_id":"","url":"https://api.github.com/users/yeputons","html_url":"https://github.com/yeputons","followers_url":"https://api.github.com/users/yeputons/followers","following_url":"https://api.github.com/users/yeputons/following{/other_user}","gists_url":"https://api.github.com/users/yeputons/gists{/gist_id}","starred_url":"https://api.github.com/users/yeputons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yeputons/subscriptions","organizations_url":"https://api.github.com/users/yeputons/orgs","repos_url":"https://api.github.com/users/yeputons/repos","events_url":"https://api.github.com/users/yeputons/events{/privacy}","received_events_url":"https://api.github.com/users/yeputons/received_events","type":"User","site_admin":false},"html_url":"https://github.com/yeputons/hse-2019-pb-tasks","description":null,"fork":false,"url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks","forks_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/forks","keys_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/teams","hooks_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/hooks","issue_events_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/events","assignees_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/tags","blobs_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/languages","stargazers_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/stargazers","contributors_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/contributors","subscribers_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/subscribers","subscription_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/subscription","commits_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/merges","archive_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/downloads","issues_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/labels{/name}","releases_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/releases{/id}","deployments_url":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/deployments","created_at":"2019-11-07T03:59:54Z","updated_at":"2019-12-05T09:21:11Z","pushed_at":"2019-12-13T13:24:35Z","git_url":"git://github.com/yeputons/hse-2019-pb-tasks.git","ssh_url":"git@github.com:yeputons/hse-2019-pb-tasks.git","clone_url":"https://github.com/yeputons/hse-2019-pb-tasks.git","svn_url":"https://github.com/yeputons/hse-2019-pb-tasks","homepage":null,"size":107,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":78,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":192,"license":null,"forks":78,"open_issues":192,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/pulls/176"},"html":{"href":"https://github.com/yeputons/hse-2019-pb-tasks/pull/176"},"issue":{"href":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/issues/176"},"comments":{"href":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/issues/176/comments"},"review_comments":{"href":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/pulls/176/comments"},"review_comment":{"href":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/pulls/176/commits"},"statuses":{"href":"https://api.github.com/repos/yeputons/hse-2019-pb-tasks/statuses/1a2a3b00f9d2bbb007d279e960fc8d5eceeb5cd6"}},"author_association":"NONE"}}
{"actor":{"display_login":"annikura"}}