{"action":"created","comment":{"url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/pulls/comments/238990833","pull_request_review_id":181663635,"id":238990833,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODk5MDgzMw==","diff_hunk":"@@ -0,0 +1,31 @@\n+package uk.codeidoscope.tictactoe.game;\n+\n+import java.util.Objects;\n+\n+public class Position {","path":"src/main/java/uk/codeidoscope/tictactoe/game/Position.java","position":5,"original_position":5,"commit_id":"06d549ea31a3533d58f99befe87b9a0bb2ffb9f4","original_commit_id":"06d549ea31a3533d58f99befe87b9a0bb2ffb9f4","user":{"login":"codeidoscope","id":30509007,"node_id":"MDQ6VXNlcjMwNTA5MDA3","avatar_url":"https://avatars3.githubusercontent.com/u/30509007?v=4","gravatar_id":"","url":"https://api.github.com/users/codeidoscope","html_url":"https://github.com/codeidoscope","followers_url":"https://api.github.com/users/codeidoscope/followers","following_url":"https://api.github.com/users/codeidoscope/following{/other_user}","gists_url":"https://api.github.com/users/codeidoscope/gists{/gist_id}","starred_url":"https://api.github.com/users/codeidoscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeidoscope/subscriptions","organizations_url":"https://api.github.com/users/codeidoscope/orgs","repos_url":"https://api.github.com/users/codeidoscope/repos","events_url":"https://api.github.com/users/codeidoscope/events{/privacy}","received_events_url":"https://api.github.com/users/codeidoscope/received_events","type":"User","site_admin":false},"body":"Originally, `Position`s and `Score`s were just `int`, which led me to have `List<List<int>>` peppered throughout my code when I needed a list of scores or a list of positions or a combination of both - as was the case in my minimax. After encountering an issue where I was accidentally comparing a position to a score, Felipe suggested I create types for each so that I would not encounter this error again, and so that it was clearer what I was expecting where. \r\n\r\nA tile used to take two ints, for example, and now it takes a score and a position, which I think makes it more legible, and also makes it harder for me to replicate that issue where I was comparing two different things.\r\n\r\nI've also got a ScoredPosition type, which holds a score and a position (instead of a list of ints) and a PossibleMoves type, which is a list of scored positions, instead of being a list of a list of ints.\r\n\r\nI do agree that it probably adds some complexity because they're essentially just wrappers, but I feel that being able to understand what my code does at a glance when looking at my `UnbeatableComputerPlayer` class, and having the extra safety of not accidentally comparing `int`s that look the same but are not the same at all is benefit enough for me to keep it that way.","created_at":"2018-12-05T09:39:44Z","updated_at":"2018-12-05T09:39:44Z","html_url":"https://github.com/codeidoscope/java-tic-tac-toe/pull/5#discussion_r238990833","pull_request_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/pulls/5","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/pulls/comments/238990833"},"html":{"href":"https://github.com/codeidoscope/java-tic-tac-toe/pull/5#discussion_r238990833"},"pull_request":{"href":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/pulls/5"}},"in_reply_to_id":238796354},"pull_request":{"url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/pulls/5","id":234381881,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0MzgxODgx","html_url":"https://github.com/codeidoscope/java-tic-tac-toe/pull/5","diff_url":"https://github.com/codeidoscope/java-tic-tac-toe/pull/5.diff","patch_url":"https://github.com/codeidoscope/java-tic-tac-toe/pull/5.patch","issue_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/issues/5","number":5,"state":"open","locked":false,"title":"Create ScoredPosition and PossibleMoves types","user":{"login":"codeidoscope","id":30509007,"node_id":"MDQ6VXNlcjMwNTA5MDA3","avatar_url":"https://avatars3.githubusercontent.com/u/30509007?v=4","gravatar_id":"","url":"https://api.github.com/users/codeidoscope","html_url":"https://github.com/codeidoscope","followers_url":"https://api.github.com/users/codeidoscope/followers","following_url":"https://api.github.com/users/codeidoscope/following{/other_user}","gists_url":"https://api.github.com/users/codeidoscope/gists{/gist_id}","starred_url":"https://api.github.com/users/codeidoscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeidoscope/subscriptions","organizations_url":"https://api.github.com/users/codeidoscope/orgs","repos_url":"https://api.github.com/users/codeidoscope/repos","events_url":"https://api.github.com/users/codeidoscope/events{/privacy}","received_events_url":"https://api.github.com/users/codeidoscope/received_events","type":"User","site_admin":false},"body":"Minimax part II:\r\n- select the highest score from a given list of scores\r\n- returns the position associated with that score","created_at":"2018-11-28T18:34:38Z","updated_at":"2018-12-05T09:39:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"184870c7f253a3b98f5901b57f9e1b30515575cf","assignee":{"login":"codeidoscope","id":30509007,"node_id":"MDQ6VXNlcjMwNTA5MDA3","avatar_url":"https://avatars3.githubusercontent.com/u/30509007?v=4","gravatar_id":"","url":"https://api.github.com/users/codeidoscope","html_url":"https://github.com/codeidoscope","followers_url":"https://api.github.com/users/codeidoscope/followers","following_url":"https://api.github.com/users/codeidoscope/following{/other_user}","gists_url":"https://api.github.com/users/codeidoscope/gists{/gist_id}","starred_url":"https://api.github.com/users/codeidoscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeidoscope/subscriptions","organizations_url":"https://api.github.com/users/codeidoscope/orgs","repos_url":"https://api.github.com/users/codeidoscope/repos","events_url":"https://api.github.com/users/codeidoscope/events{/privacy}","received_events_url":"https://api.github.com/users/codeidoscope/received_events","type":"User","site_admin":false},"assignees":[{"login":"codeidoscope","id":30509007,"node_id":"MDQ6VXNlcjMwNTA5MDA3","avatar_url":"https://avatars3.githubusercontent.com/u/30509007?v=4","gravatar_id":"","url":"https://api.github.com/users/codeidoscope","html_url":"https://github.com/codeidoscope","followers_url":"https://api.github.com/users/codeidoscope/followers","following_url":"https://api.github.com/users/codeidoscope/following{/other_user}","gists_url":"https://api.github.com/users/codeidoscope/gists{/gist_id}","starred_url":"https://api.github.com/users/codeidoscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeidoscope/subscriptions","organizations_url":"https://api.github.com/users/codeidoscope/orgs","repos_url":"https://api.github.com/users/codeidoscope/repos","events_url":"https://api.github.com/users/codeidoscope/events{/privacy}","received_events_url":"https://api.github.com/users/codeidoscope/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/pulls/5/commits","review_comments_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/pulls/5/comments","review_comment_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/issues/5/comments","statuses_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/statuses/06d549ea31a3533d58f99befe87b9a0bb2ffb9f4","head":{"label":"codeidoscope:pick-outcome","ref":"pick-outcome","sha":"06d549ea31a3533d58f99befe87b9a0bb2ffb9f4","user":{"login":"codeidoscope","id":30509007,"node_id":"MDQ6VXNlcjMwNTA5MDA3","avatar_url":"https://avatars3.githubusercontent.com/u/30509007?v=4","gravatar_id":"","url":"https://api.github.com/users/codeidoscope","html_url":"https://github.com/codeidoscope","followers_url":"https://api.github.com/users/codeidoscope/followers","following_url":"https://api.github.com/users/codeidoscope/following{/other_user}","gists_url":"https://api.github.com/users/codeidoscope/gists{/gist_id}","starred_url":"https://api.github.com/users/codeidoscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeidoscope/subscriptions","organizations_url":"https://api.github.com/users/codeidoscope/orgs","repos_url":"https://api.github.com/users/codeidoscope/repos","events_url":"https://api.github.com/users/codeidoscope/events{/privacy}","received_events_url":"https://api.github.com/users/codeidoscope/received_events","type":"User","site_admin":false},"repo":{"id":152084889,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIwODQ4ODk=","name":"java-tic-tac-toe","full_name":"codeidoscope/java-tic-tac-toe","private":false,"owner":{"login":"codeidoscope","id":30509007,"node_id":"MDQ6VXNlcjMwNTA5MDA3","avatar_url":"https://avatars3.githubusercontent.com/u/30509007?v=4","gravatar_id":"","url":"https://api.github.com/users/codeidoscope","html_url":"https://github.com/codeidoscope","followers_url":"https://api.github.com/users/codeidoscope/followers","following_url":"https://api.github.com/users/codeidoscope/following{/other_user}","gists_url":"https://api.github.com/users/codeidoscope/gists{/gist_id}","starred_url":"https://api.github.com/users/codeidoscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeidoscope/subscriptions","organizations_url":"https://api.github.com/users/codeidoscope/orgs","repos_url":"https://api.github.com/users/codeidoscope/repos","events_url":"https://api.github.com/users/codeidoscope/events{/privacy}","received_events_url":"https://api.github.com/users/codeidoscope/received_events","type":"User","site_admin":false},"html_url":"https://github.com/codeidoscope/java-tic-tac-toe","description":"Tic Tac Toe in Java","fork":false,"url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe","forks_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/forks","keys_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/teams","hooks_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/hooks","issue_events_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/issues/events{/number}","events_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/events","assignees_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/assignees{/user}","branches_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/branches{/branch}","tags_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/tags","blobs_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/git/refs{/sha}","trees_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/statuses/{sha}","languages_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/languages","stargazers_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/stargazers","contributors_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/contributors","subscribers_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/subscribers","subscription_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/subscription","commits_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/commits{/sha}","git_commits_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/git/commits{/sha}","comments_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/comments{/number}","issue_comment_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/issues/comments{/number}","contents_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/contents/{+path}","compare_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/merges","archive_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/downloads","issues_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/issues{/number}","pulls_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/pulls{/number}","milestones_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/milestones{/number}","notifications_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/labels{/name}","releases_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/releases{/id}","deployments_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/deployments","created_at":"2018-10-08T13:29:09Z","updated_at":"2018-12-03T10:06:17Z","pushed_at":"2018-12-04T13:35:21Z","git_url":"git://github.com/codeidoscope/java-tic-tac-toe.git","ssh_url":"git@github.com:codeidoscope/java-tic-tac-toe.git","clone_url":"https://github.com/codeidoscope/java-tic-tac-toe.git","svn_url":"https://github.com/codeidoscope/java-tic-tac-toe","homepage":null,"size":90,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"codeidoscope:calculate-best-move","ref":"calculate-best-move","sha":"e00b0fa98122fd6aba83d55d88f35c343da20ae9","user":{"login":"codeidoscope","id":30509007,"node_id":"MDQ6VXNlcjMwNTA5MDA3","avatar_url":"https://avatars3.githubusercontent.com/u/30509007?v=4","gravatar_id":"","url":"https://api.github.com/users/codeidoscope","html_url":"https://github.com/codeidoscope","followers_url":"https://api.github.com/users/codeidoscope/followers","following_url":"https://api.github.com/users/codeidoscope/following{/other_user}","gists_url":"https://api.github.com/users/codeidoscope/gists{/gist_id}","starred_url":"https://api.github.com/users/codeidoscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeidoscope/subscriptions","organizations_url":"https://api.github.com/users/codeidoscope/orgs","repos_url":"https://api.github.com/users/codeidoscope/repos","events_url":"https://api.github.com/users/codeidoscope/events{/privacy}","received_events_url":"https://api.github.com/users/codeidoscope/received_events","type":"User","site_admin":false},"repo":{"id":152084889,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIwODQ4ODk=","name":"java-tic-tac-toe","full_name":"codeidoscope/java-tic-tac-toe","private":false,"owner":{"login":"codeidoscope","id":30509007,"node_id":"MDQ6VXNlcjMwNTA5MDA3","avatar_url":"https://avatars3.githubusercontent.com/u/30509007?v=4","gravatar_id":"","url":"https://api.github.com/users/codeidoscope","html_url":"https://github.com/codeidoscope","followers_url":"https://api.github.com/users/codeidoscope/followers","following_url":"https://api.github.com/users/codeidoscope/following{/other_user}","gists_url":"https://api.github.com/users/codeidoscope/gists{/gist_id}","starred_url":"https://api.github.com/users/codeidoscope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeidoscope/subscriptions","organizations_url":"https://api.github.com/users/codeidoscope/orgs","repos_url":"https://api.github.com/users/codeidoscope/repos","events_url":"https://api.github.com/users/codeidoscope/events{/privacy}","received_events_url":"https://api.github.com/users/codeidoscope/received_events","type":"User","site_admin":false},"html_url":"https://github.com/codeidoscope/java-tic-tac-toe","description":"Tic Tac Toe in Java","fork":false,"url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe","forks_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/forks","keys_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/teams","hooks_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/hooks","issue_events_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/issues/events{/number}","events_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/events","assignees_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/assignees{/user}","branches_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/branches{/branch}","tags_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/tags","blobs_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/git/refs{/sha}","trees_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/statuses/{sha}","languages_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/languages","stargazers_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/stargazers","contributors_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/contributors","subscribers_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/subscribers","subscription_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/subscription","commits_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/commits{/sha}","git_commits_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/git/commits{/sha}","comments_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/comments{/number}","issue_comment_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/issues/comments{/number}","contents_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/contents/{+path}","compare_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/merges","archive_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/downloads","issues_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/issues{/number}","pulls_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/pulls{/number}","milestones_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/milestones{/number}","notifications_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/labels{/name}","releases_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/releases{/id}","deployments_url":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/deployments","created_at":"2018-10-08T13:29:09Z","updated_at":"2018-12-03T10:06:17Z","pushed_at":"2018-12-04T13:35:21Z","git_url":"git://github.com/codeidoscope/java-tic-tac-toe.git","ssh_url":"git@github.com:codeidoscope/java-tic-tac-toe.git","clone_url":"https://github.com/codeidoscope/java-tic-tac-toe.git","svn_url":"https://github.com/codeidoscope/java-tic-tac-toe","homepage":null,"size":90,"stargazers_count":0,"watchers_count":0,"language":"Java","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/codeidoscope/java-tic-tac-toe/pulls/5"},"html":{"href":"https://github.com/codeidoscope/java-tic-tac-toe/pull/5"},"issue":{"href":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/issues/5"},"comments":{"href":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/codeidoscope/java-tic-tac-toe/statuses/06d549ea31a3533d58f99befe87b9a0bb2ffb9f4"}},"author_association":"OWNER"}}
{"actor":{"display_login":"codeidoscope"}}