{"action":"created","comment":{"url":"https://api.github.com/repos/shibani/elixir-tictactoe/pulls/comments/219247327","pull_request_review_id":157378186,"id":219247327,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTI0NzMyNw==","diff_hunk":"@@ -1,23 +1,50 @@\n defmodule Game do\n \n   def mark_square(board, row, column, icon) do\n-    old_row = MatrixBoard.get_row_at(board, row)\n+    old_row = Board.get_row_at(board, row)\n     new_row = List.replace_at(old_row, column, icon)\n     List.replace_at(board, row, new_row)\n   end\n \n   def has_win?(board) do\n-    MatrixBoard.has_winning_row?(board) ||\n-    MatrixBoard.has_winning_column?(board) ||\n-    MatrixBoard.has_winning_diagonal?(board)\n+    Rules.has_winning_row?(board) ||\n+    Rules.has_winning_column?(board) ||\n+    Rules.has_winning_diagonal?(board)\n   end\n \n   def is_tied?(board) do\n-    MatrixBoard.is_full?(board) && !Game.has_win?(board)\n+    Board.is_full?(board) && !Game.has_win?(board)\n   end\n \n   def is_over?(board) do\n-    MatrixBoard.is_full?(board) || Game.has_win?(board)\n+    Board.is_full?(board) || Game.has_win?(board)\n+  end\n+\n+  def switch_player(player_list, current_player \\\\ nil) do\n+    cond do\n+      current_player == nil ->\n+        List.first(player_list)\n+      Map.equal?(current_player, List.last(player_list)) ->\n+        List.first(player_list)\n+      Map.equal?(current_player, List.first(player_list)) ->\n+        List.last(player_list)\n+    end\n+  end\n+\n+  def square_to_rows_and_cols(square, row_size) do\n+    [\n+      div(square - 1, row_size),\n+      rem(square - 1, row_size)\n+    ]\n+  end\n+\n+  def rows_and_cols_to_square(row, col, row_size) do\n+    row * row_size + col + 1\n+  end\n+\n+  def valid_move?(board, square, row_size) do","path":"lib/game_modules/game.ex","position":51,"original_position":51,"commit_id":"575a05727ed45346b75d562bc172039ed6cab371","original_commit_id":"575a05727ed45346b75d562bc172039ed6cab371","user":{"login":"shibani","id":874357,"node_id":"MDQ6VXNlcjg3NDM1Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/874357?v=4","gravatar_id":"","url":"https://api.github.com/users/shibani","html_url":"https://github.com/shibani","followers_url":"https://api.github.com/users/shibani/followers","following_url":"https://api.github.com/users/shibani/following{/other_user}","gists_url":"https://api.github.com/users/shibani/gists{/gist_id}","starred_url":"https://api.github.com/users/shibani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shibani/subscriptions","organizations_url":"https://api.github.com/users/shibani/orgs","repos_url":"https://api.github.com/users/shibani/repos","events_url":"https://api.github.com/users/shibani/events{/privacy}","received_events_url":"https://api.github.com/users/shibani/received_events","type":"User","site_admin":false},"body":"Leaving this method here for now, to be moved to a better place later.","created_at":"2018-09-20T17:15:13Z","updated_at":"2018-09-20T17:15:13Z","html_url":"https://github.com/shibani/elixir-tictactoe/pull/2#discussion_r219247327","pull_request_url":"https://api.github.com/repos/shibani/elixir-tictactoe/pulls/2","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/shibani/elixir-tictactoe/pulls/comments/219247327"},"html":{"href":"https://github.com/shibani/elixir-tictactoe/pull/2#discussion_r219247327"},"pull_request":{"href":"https://api.github.com/repos/shibani/elixir-tictactoe/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/shibani/elixir-tictactoe/pulls/2","id":216661776,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2NjYxNzc2","html_url":"https://github.com/shibani/elixir-tictactoe/pull/2","diff_url":"https://github.com/shibani/elixir-tictactoe/pull/2.diff","patch_url":"https://github.com/shibani/elixir-tictactoe/pull/2.patch","issue_url":"https://api.github.com/repos/shibani/elixir-tictactoe/issues/2","number":2,"state":"open","locked":false,"title":"adding test for player module","user":{"login":"shibani","id":874357,"node_id":"MDQ6VXNlcjg3NDM1Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/874357?v=4","gravatar_id":"","url":"https://api.github.com/users/shibani","html_url":"https://github.com/shibani","followers_url":"https://api.github.com/users/shibani/followers","following_url":"https://api.github.com/users/shibani/following{/other_user}","gists_url":"https://api.github.com/users/shibani/gists{/gist_id}","starred_url":"https://api.github.com/users/shibani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shibani/subscriptions","organizations_url":"https://api.github.com/users/shibani/orgs","repos_url":"https://api.github.com/users/shibani/repos","events_url":"https://api.github.com/users/shibani/events{/privacy}","received_events_url":"https://api.github.com/users/shibani/received_events","type":"User","site_admin":false},"body":"🚧DO NOT MERGE 🚧\r\n\r\n## Pivotal Link\r\nhttps://www.pivotaltracker.com/story/show/160571496\r\n\r\n## Description\r\n- Create tests for Player methods\r\n- Add Player methods","created_at":"2018-09-19T14:31:46Z","updated_at":"2018-09-20T17:15:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5ed6536749112c4d7040f7228713c1664366da76","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/shibani/elixir-tictactoe/pulls/2/commits","review_comments_url":"https://api.github.com/repos/shibani/elixir-tictactoe/pulls/2/comments","review_comment_url":"https://api.github.com/repos/shibani/elixir-tictactoe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shibani/elixir-tictactoe/issues/2/comments","statuses_url":"https://api.github.com/repos/shibani/elixir-tictactoe/statuses/575a05727ed45346b75d562bc172039ed6cab371","head":{"label":"shibani:feature/#160571496/player-methods","ref":"feature/#160571496/player-methods","sha":"575a05727ed45346b75d562bc172039ed6cab371","user":{"login":"shibani","id":874357,"node_id":"MDQ6VXNlcjg3NDM1Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/874357?v=4","gravatar_id":"","url":"https://api.github.com/users/shibani","html_url":"https://github.com/shibani","followers_url":"https://api.github.com/users/shibani/followers","following_url":"https://api.github.com/users/shibani/following{/other_user}","gists_url":"https://api.github.com/users/shibani/gists{/gist_id}","starred_url":"https://api.github.com/users/shibani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shibani/subscriptions","organizations_url":"https://api.github.com/users/shibani/orgs","repos_url":"https://api.github.com/users/shibani/repos","events_url":"https://api.github.com/users/shibani/events{/privacy}","received_events_url":"https://api.github.com/users/shibani/received_events","type":"User","site_admin":false},"repo":{"id":149186223,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkxODYyMjM=","name":"elixir-tictactoe","full_name":"shibani/elixir-tictactoe","private":false,"owner":{"login":"shibani","id":874357,"node_id":"MDQ6VXNlcjg3NDM1Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/874357?v=4","gravatar_id":"","url":"https://api.github.com/users/shibani","html_url":"https://github.com/shibani","followers_url":"https://api.github.com/users/shibani/followers","following_url":"https://api.github.com/users/shibani/following{/other_user}","gists_url":"https://api.github.com/users/shibani/gists{/gist_id}","starred_url":"https://api.github.com/users/shibani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shibani/subscriptions","organizations_url":"https://api.github.com/users/shibani/orgs","repos_url":"https://api.github.com/users/shibani/repos","events_url":"https://api.github.com/users/shibani/events{/privacy}","received_events_url":"https://api.github.com/users/shibani/received_events","type":"User","site_admin":false},"html_url":"https://github.com/shibani/elixir-tictactoe","description":null,"fork":false,"url":"https://api.github.com/repos/shibani/elixir-tictactoe","forks_url":"https://api.github.com/repos/shibani/elixir-tictactoe/forks","keys_url":"https://api.github.com/repos/shibani/elixir-tictactoe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shibani/elixir-tictactoe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shibani/elixir-tictactoe/teams","hooks_url":"https://api.github.com/repos/shibani/elixir-tictactoe/hooks","issue_events_url":"https://api.github.com/repos/shibani/elixir-tictactoe/issues/events{/number}","events_url":"https://api.github.com/repos/shibani/elixir-tictactoe/events","assignees_url":"https://api.github.com/repos/shibani/elixir-tictactoe/assignees{/user}","branches_url":"https://api.github.com/repos/shibani/elixir-tictactoe/branches{/branch}","tags_url":"https://api.github.com/repos/shibani/elixir-tictactoe/tags","blobs_url":"https://api.github.com/repos/shibani/elixir-tictactoe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shibani/elixir-tictactoe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shibani/elixir-tictactoe/git/refs{/sha}","trees_url":"https://api.github.com/repos/shibani/elixir-tictactoe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shibani/elixir-tictactoe/statuses/{sha}","languages_url":"https://api.github.com/repos/shibani/elixir-tictactoe/languages","stargazers_url":"https://api.github.com/repos/shibani/elixir-tictactoe/stargazers","contributors_url":"https://api.github.com/repos/shibani/elixir-tictactoe/contributors","subscribers_url":"https://api.github.com/repos/shibani/elixir-tictactoe/subscribers","subscription_url":"https://api.github.com/repos/shibani/elixir-tictactoe/subscription","commits_url":"https://api.github.com/repos/shibani/elixir-tictactoe/commits{/sha}","git_commits_url":"https://api.github.com/repos/shibani/elixir-tictactoe/git/commits{/sha}","comments_url":"https://api.github.com/repos/shibani/elixir-tictactoe/comments{/number}","issue_comment_url":"https://api.github.com/repos/shibani/elixir-tictactoe/issues/comments{/number}","contents_url":"https://api.github.com/repos/shibani/elixir-tictactoe/contents/{+path}","compare_url":"https://api.github.com/repos/shibani/elixir-tictactoe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shibani/elixir-tictactoe/merges","archive_url":"https://api.github.com/repos/shibani/elixir-tictactoe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shibani/elixir-tictactoe/downloads","issues_url":"https://api.github.com/repos/shibani/elixir-tictactoe/issues{/number}","pulls_url":"https://api.github.com/repos/shibani/elixir-tictactoe/pulls{/number}","milestones_url":"https://api.github.com/repos/shibani/elixir-tictactoe/milestones{/number}","notifications_url":"https://api.github.com/repos/shibani/elixir-tictactoe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shibani/elixir-tictactoe/labels{/name}","releases_url":"https://api.github.com/repos/shibani/elixir-tictactoe/releases{/id}","deployments_url":"https://api.github.com/repos/shibani/elixir-tictactoe/deployments","created_at":"2018-09-17T20:48:26Z","updated_at":"2018-09-19T14:23:05Z","pushed_at":"2018-09-20T17:11:05Z","git_url":"git://github.com/shibani/elixir-tictactoe.git","ssh_url":"git@github.com:shibani/elixir-tictactoe.git","clone_url":"https://github.com/shibani/elixir-tictactoe.git","svn_url":"https://github.com/shibani/elixir-tictactoe","homepage":null,"size":16,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"shibani:master","ref":"master","sha":"dd4e35513f7537432205c86acf4422b770fda2a9","user":{"login":"shibani","id":874357,"node_id":"MDQ6VXNlcjg3NDM1Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/874357?v=4","gravatar_id":"","url":"https://api.github.com/users/shibani","html_url":"https://github.com/shibani","followers_url":"https://api.github.com/users/shibani/followers","following_url":"https://api.github.com/users/shibani/following{/other_user}","gists_url":"https://api.github.com/users/shibani/gists{/gist_id}","starred_url":"https://api.github.com/users/shibani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shibani/subscriptions","organizations_url":"https://api.github.com/users/shibani/orgs","repos_url":"https://api.github.com/users/shibani/repos","events_url":"https://api.github.com/users/shibani/events{/privacy}","received_events_url":"https://api.github.com/users/shibani/received_events","type":"User","site_admin":false},"repo":{"id":149186223,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkxODYyMjM=","name":"elixir-tictactoe","full_name":"shibani/elixir-tictactoe","private":false,"owner":{"login":"shibani","id":874357,"node_id":"MDQ6VXNlcjg3NDM1Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/874357?v=4","gravatar_id":"","url":"https://api.github.com/users/shibani","html_url":"https://github.com/shibani","followers_url":"https://api.github.com/users/shibani/followers","following_url":"https://api.github.com/users/shibani/following{/other_user}","gists_url":"https://api.github.com/users/shibani/gists{/gist_id}","starred_url":"https://api.github.com/users/shibani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shibani/subscriptions","organizations_url":"https://api.github.com/users/shibani/orgs","repos_url":"https://api.github.com/users/shibani/repos","events_url":"https://api.github.com/users/shibani/events{/privacy}","received_events_url":"https://api.github.com/users/shibani/received_events","type":"User","site_admin":false},"html_url":"https://github.com/shibani/elixir-tictactoe","description":null,"fork":false,"url":"https://api.github.com/repos/shibani/elixir-tictactoe","forks_url":"https://api.github.com/repos/shibani/elixir-tictactoe/forks","keys_url":"https://api.github.com/repos/shibani/elixir-tictactoe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shibani/elixir-tictactoe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shibani/elixir-tictactoe/teams","hooks_url":"https://api.github.com/repos/shibani/elixir-tictactoe/hooks","issue_events_url":"https://api.github.com/repos/shibani/elixir-tictactoe/issues/events{/number}","events_url":"https://api.github.com/repos/shibani/elixir-tictactoe/events","assignees_url":"https://api.github.com/repos/shibani/elixir-tictactoe/assignees{/user}","branches_url":"https://api.github.com/repos/shibani/elixir-tictactoe/branches{/branch}","tags_url":"https://api.github.com/repos/shibani/elixir-tictactoe/tags","blobs_url":"https://api.github.com/repos/shibani/elixir-tictactoe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shibani/elixir-tictactoe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shibani/elixir-tictactoe/git/refs{/sha}","trees_url":"https://api.github.com/repos/shibani/elixir-tictactoe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shibani/elixir-tictactoe/statuses/{sha}","languages_url":"https://api.github.com/repos/shibani/elixir-tictactoe/languages","stargazers_url":"https://api.github.com/repos/shibani/elixir-tictactoe/stargazers","contributors_url":"https://api.github.com/repos/shibani/elixir-tictactoe/contributors","subscribers_url":"https://api.github.com/repos/shibani/elixir-tictactoe/subscribers","subscription_url":"https://api.github.com/repos/shibani/elixir-tictactoe/subscription","commits_url":"https://api.github.com/repos/shibani/elixir-tictactoe/commits{/sha}","git_commits_url":"https://api.github.com/repos/shibani/elixir-tictactoe/git/commits{/sha}","comments_url":"https://api.github.com/repos/shibani/elixir-tictactoe/comments{/number}","issue_comment_url":"https://api.github.com/repos/shibani/elixir-tictactoe/issues/comments{/number}","contents_url":"https://api.github.com/repos/shibani/elixir-tictactoe/contents/{+path}","compare_url":"https://api.github.com/repos/shibani/elixir-tictactoe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shibani/elixir-tictactoe/merges","archive_url":"https://api.github.com/repos/shibani/elixir-tictactoe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shibani/elixir-tictactoe/downloads","issues_url":"https://api.github.com/repos/shibani/elixir-tictactoe/issues{/number}","pulls_url":"https://api.github.com/repos/shibani/elixir-tictactoe/pulls{/number}","milestones_url":"https://api.github.com/repos/shibani/elixir-tictactoe/milestones{/number}","notifications_url":"https://api.github.com/repos/shibani/elixir-tictactoe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shibani/elixir-tictactoe/labels{/name}","releases_url":"https://api.github.com/repos/shibani/elixir-tictactoe/releases{/id}","deployments_url":"https://api.github.com/repos/shibani/elixir-tictactoe/deployments","created_at":"2018-09-17T20:48:26Z","updated_at":"2018-09-19T14:23:05Z","pushed_at":"2018-09-20T17:11:05Z","git_url":"git://github.com/shibani/elixir-tictactoe.git","ssh_url":"git@github.com:shibani/elixir-tictactoe.git","clone_url":"https://github.com/shibani/elixir-tictactoe.git","svn_url":"https://github.com/shibani/elixir-tictactoe","homepage":null,"size":16,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shibani/elixir-tictactoe/pulls/2"},"html":{"href":"https://github.com/shibani/elixir-tictactoe/pull/2"},"issue":{"href":"https://api.github.com/repos/shibani/elixir-tictactoe/issues/2"},"comments":{"href":"https://api.github.com/repos/shibani/elixir-tictactoe/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/shibani/elixir-tictactoe/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/shibani/elixir-tictactoe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shibani/elixir-tictactoe/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/shibani/elixir-tictactoe/statuses/575a05727ed45346b75d562bc172039ed6cab371"}},"author_association":"OWNER"}}
{"actor":{"display_login":"shibani"}}