{"action":"created","comment":{"url":"https://api.github.com/repos/aimacode/aima-python/pulls/comments/168019067","pull_request_review_id":96320715,"id":168019067,"diff_hunk":"@@ -404,12 +404,84 @@ def astar_search(problem, h=None):\n # ______________________________________________________________________________\n # A* heuristics \n \n-class EightPuzzle():\n+class EightPuzzle(Problem):\n \n-    def __init__(self):\n-        self.path = []\n-        self.final = []\n+    \"\"\"The problem of sliding tiles numbered from 1 to 8 on a 3x3 board,\n+    where one of the squares is a blank. A state is represented as a 3x3 list,\n+    where element at index i,j represents the tile number (0 if it's an empty square).\"\"\"\n+ \n+    def __init__(self, initial, goal=None):\n+        if goal:\n+            self.goal = goal\n+        else:\n+            self.goal = [ [0,1,2], \n+                          [3,4,5], \n+                          [6,7,8] ]\n+        Problem.__init__(self, initial, goal)\n     \n+    def find_blank_square(self, state):\n+        \"\"\"Return the index of the blank square in a given state.\"\"\"\n+        for row in len(state):\n+            for column in len(row):\n+                if state[row][column]==0:\n+                    index_blank_square = (row,column)","path":"search.py","position":28,"original_position":28,"commit_id":"0850239b01bf16fb386c46ffda7e62b6ec9c79ed","original_commit_id":"e278e5d94055af2f04b15599b553d4dc94ffcf90","user":{"login":"MrDupin","id":17463361,"avatar_url":"https://avatars3.githubusercontent.com/u/17463361?v=4","gravatar_id":"","url":"https://api.github.com/users/MrDupin","html_url":"https://github.com/MrDupin","followers_url":"https://api.github.com/users/MrDupin/followers","following_url":"https://api.github.com/users/MrDupin/following{/other_user}","gists_url":"https://api.github.com/users/MrDupin/gists{/gist_id}","starred_url":"https://api.github.com/users/MrDupin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrDupin/subscriptions","organizations_url":"https://api.github.com/users/MrDupin/orgs","repos_url":"https://api.github.com/users/MrDupin/repos","events_url":"https://api.github.com/users/MrDupin/events{/privacy}","received_events_url":"https://api.github.com/users/MrDupin/received_events","type":"User","site_admin":false},"body":"A space after the comma is needed.","created_at":"2018-02-13T22:14:18Z","updated_at":"2018-02-13T22:18:54Z","html_url":"https://github.com/aimacode/aima-python/pull/733#discussion_r168019067","pull_request_url":"https://api.github.com/repos/aimacode/aima-python/pulls/733","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/aimacode/aima-python/pulls/comments/168019067"},"html":{"href":"https://github.com/aimacode/aima-python/pull/733#discussion_r168019067"},"pull_request":{"href":"https://api.github.com/repos/aimacode/aima-python/pulls/733"}}},"pull_request":{"url":"https://api.github.com/repos/aimacode/aima-python/pulls/733","id":168909302,"html_url":"https://github.com/aimacode/aima-python/pull/733","diff_url":"https://github.com/aimacode/aima-python/pull/733.diff","patch_url":"https://github.com/aimacode/aima-python/pull/733.patch","issue_url":"https://api.github.com/repos/aimacode/aima-python/issues/733","number":733,"state":"open","locked":false,"title":"Fix EightPuzzle class implementation in search.py (#710)","user":{"login":"SasankYadati","id":13199167,"avatar_url":"https://avatars1.githubusercontent.com/u/13199167?v=4","gravatar_id":"","url":"https://api.github.com/users/SasankYadati","html_url":"https://github.com/SasankYadati","followers_url":"https://api.github.com/users/SasankYadati/followers","following_url":"https://api.github.com/users/SasankYadati/following{/other_user}","gists_url":"https://api.github.com/users/SasankYadati/gists{/gist_id}","starred_url":"https://api.github.com/users/SasankYadati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SasankYadati/subscriptions","organizations_url":"https://api.github.com/users/SasankYadati/orgs","repos_url":"https://api.github.com/users/SasankYadati/repos","events_url":"https://api.github.com/users/SasankYadati/events{/privacy}","received_events_url":"https://api.github.com/users/SasankYadati/received_events","type":"User","site_admin":false},"body":"In `search.py`, Environments / Problems are defined as classes which are derived from the `Problem` class. In these changes I made, I rewrote most of `EightPuzzle` class as a derived class of `Problem`. Ran the tests using py.test and also made sure the code is Python 3.4 complaint. Please review my changes and let me know your thoughts. Thanks.","created_at":"2018-02-13T17:32:45Z","updated_at":"2018-02-13T22:18:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68d152d84635a178382bfd77101ea44ed5eedad8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aimacode/aima-python/pulls/733/commits","review_comments_url":"https://api.github.com/repos/aimacode/aima-python/pulls/733/comments","review_comment_url":"https://api.github.com/repos/aimacode/aima-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aimacode/aima-python/issues/733/comments","statuses_url":"https://api.github.com/repos/aimacode/aima-python/statuses/0850239b01bf16fb386c46ffda7e62b6ec9c79ed","head":{"label":"SasankYadati:master","ref":"master","sha":"0850239b01bf16fb386c46ffda7e62b6ec9c79ed","user":{"login":"SasankYadati","id":13199167,"avatar_url":"https://avatars1.githubusercontent.com/u/13199167?v=4","gravatar_id":"","url":"https://api.github.com/users/SasankYadati","html_url":"https://github.com/SasankYadati","followers_url":"https://api.github.com/users/SasankYadati/followers","following_url":"https://api.github.com/users/SasankYadati/following{/other_user}","gists_url":"https://api.github.com/users/SasankYadati/gists{/gist_id}","starred_url":"https://api.github.com/users/SasankYadati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SasankYadati/subscriptions","organizations_url":"https://api.github.com/users/SasankYadati/orgs","repos_url":"https://api.github.com/users/SasankYadati/repos","events_url":"https://api.github.com/users/SasankYadati/events{/privacy}","received_events_url":"https://api.github.com/users/SasankYadati/received_events","type":"User","site_admin":false},"repo":{"id":121410889,"name":"aima-python","full_name":"SasankYadati/aima-python","owner":{"login":"SasankYadati","id":13199167,"avatar_url":"https://avatars1.githubusercontent.com/u/13199167?v=4","gravatar_id":"","url":"https://api.github.com/users/SasankYadati","html_url":"https://github.com/SasankYadati","followers_url":"https://api.github.com/users/SasankYadati/followers","following_url":"https://api.github.com/users/SasankYadati/following{/other_user}","gists_url":"https://api.github.com/users/SasankYadati/gists{/gist_id}","starred_url":"https://api.github.com/users/SasankYadati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SasankYadati/subscriptions","organizations_url":"https://api.github.com/users/SasankYadati/orgs","repos_url":"https://api.github.com/users/SasankYadati/repos","events_url":"https://api.github.com/users/SasankYadati/events{/privacy}","received_events_url":"https://api.github.com/users/SasankYadati/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SasankYadati/aima-python","description":"Python implementation of algorithms from Russell And Norvig's \"Artificial Intelligence - A Modern Approach\"","fork":true,"url":"https://api.github.com/repos/SasankYadati/aima-python","forks_url":"https://api.github.com/repos/SasankYadati/aima-python/forks","keys_url":"https://api.github.com/repos/SasankYadati/aima-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SasankYadati/aima-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SasankYadati/aima-python/teams","hooks_url":"https://api.github.com/repos/SasankYadati/aima-python/hooks","issue_events_url":"https://api.github.com/repos/SasankYadati/aima-python/issues/events{/number}","events_url":"https://api.github.com/repos/SasankYadati/aima-python/events","assignees_url":"https://api.github.com/repos/SasankYadati/aima-python/assignees{/user}","branches_url":"https://api.github.com/repos/SasankYadati/aima-python/branches{/branch}","tags_url":"https://api.github.com/repos/SasankYadati/aima-python/tags","blobs_url":"https://api.github.com/repos/SasankYadati/aima-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SasankYadati/aima-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SasankYadati/aima-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/SasankYadati/aima-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SasankYadati/aima-python/statuses/{sha}","languages_url":"https://api.github.com/repos/SasankYadati/aima-python/languages","stargazers_url":"https://api.github.com/repos/SasankYadati/aima-python/stargazers","contributors_url":"https://api.github.com/repos/SasankYadati/aima-python/contributors","subscribers_url":"https://api.github.com/repos/SasankYadati/aima-python/subscribers","subscription_url":"https://api.github.com/repos/SasankYadati/aima-python/subscription","commits_url":"https://api.github.com/repos/SasankYadati/aima-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/SasankYadati/aima-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/SasankYadati/aima-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/SasankYadati/aima-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/SasankYadati/aima-python/contents/{+path}","compare_url":"https://api.github.com/repos/SasankYadati/aima-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SasankYadati/aima-python/merges","archive_url":"https://api.github.com/repos/SasankYadati/aima-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SasankYadati/aima-python/downloads","issues_url":"https://api.github.com/repos/SasankYadati/aima-python/issues{/number}","pulls_url":"https://api.github.com/repos/SasankYadati/aima-python/pulls{/number}","milestones_url":"https://api.github.com/repos/SasankYadati/aima-python/milestones{/number}","notifications_url":"https://api.github.com/repos/SasankYadati/aima-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SasankYadati/aima-python/labels{/name}","releases_url":"https://api.github.com/repos/SasankYadati/aima-python/releases{/id}","deployments_url":"https://api.github.com/repos/SasankYadati/aima-python/deployments","created_at":"2018-02-13T17:10:07Z","updated_at":"2018-02-13T17:10:09Z","pushed_at":"2018-02-13T17:18:18Z","git_url":"git://github.com/SasankYadati/aima-python.git","ssh_url":"git@github.com:SasankYadati/aima-python.git","clone_url":"https://github.com/SasankYadati/aima-python.git","svn_url":"https://github.com/SasankYadati/aima-python","homepage":"","size":8174,"stargazers_count":0,"watchers_count":0,"language":"Jupyter Notebook","has_issues":false,"has_projects":true,"has_downloads":false,"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":"aimacode:master","ref":"master","sha":"9ccc092b70db3d1b9c1bb36c51123092f79e3a93","user":{"login":"aimacode","id":17015933,"avatar_url":"https://avatars2.githubusercontent.com/u/17015933?v=4","gravatar_id":"","url":"https://api.github.com/users/aimacode","html_url":"https://github.com/aimacode","followers_url":"https://api.github.com/users/aimacode/followers","following_url":"https://api.github.com/users/aimacode/following{/other_user}","gists_url":"https://api.github.com/users/aimacode/gists{/gist_id}","starred_url":"https://api.github.com/users/aimacode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aimacode/subscriptions","organizations_url":"https://api.github.com/users/aimacode/orgs","repos_url":"https://api.github.com/users/aimacode/repos","events_url":"https://api.github.com/users/aimacode/events{/privacy}","received_events_url":"https://api.github.com/users/aimacode/received_events","type":"Organization","site_admin":false},"repo":{"id":50881110,"name":"aima-python","full_name":"aimacode/aima-python","owner":{"login":"aimacode","id":17015933,"avatar_url":"https://avatars2.githubusercontent.com/u/17015933?v=4","gravatar_id":"","url":"https://api.github.com/users/aimacode","html_url":"https://github.com/aimacode","followers_url":"https://api.github.com/users/aimacode/followers","following_url":"https://api.github.com/users/aimacode/following{/other_user}","gists_url":"https://api.github.com/users/aimacode/gists{/gist_id}","starred_url":"https://api.github.com/users/aimacode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aimacode/subscriptions","organizations_url":"https://api.github.com/users/aimacode/orgs","repos_url":"https://api.github.com/users/aimacode/repos","events_url":"https://api.github.com/users/aimacode/events{/privacy}","received_events_url":"https://api.github.com/users/aimacode/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aimacode/aima-python","description":"Python implementation of algorithms from Russell And Norvig's \"Artificial Intelligence - A Modern Approach\"","fork":false,"url":"https://api.github.com/repos/aimacode/aima-python","forks_url":"https://api.github.com/repos/aimacode/aima-python/forks","keys_url":"https://api.github.com/repos/aimacode/aima-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aimacode/aima-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aimacode/aima-python/teams","hooks_url":"https://api.github.com/repos/aimacode/aima-python/hooks","issue_events_url":"https://api.github.com/repos/aimacode/aima-python/issues/events{/number}","events_url":"https://api.github.com/repos/aimacode/aima-python/events","assignees_url":"https://api.github.com/repos/aimacode/aima-python/assignees{/user}","branches_url":"https://api.github.com/repos/aimacode/aima-python/branches{/branch}","tags_url":"https://api.github.com/repos/aimacode/aima-python/tags","blobs_url":"https://api.github.com/repos/aimacode/aima-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aimacode/aima-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aimacode/aima-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/aimacode/aima-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aimacode/aima-python/statuses/{sha}","languages_url":"https://api.github.com/repos/aimacode/aima-python/languages","stargazers_url":"https://api.github.com/repos/aimacode/aima-python/stargazers","contributors_url":"https://api.github.com/repos/aimacode/aima-python/contributors","subscribers_url":"https://api.github.com/repos/aimacode/aima-python/subscribers","subscription_url":"https://api.github.com/repos/aimacode/aima-python/subscription","commits_url":"https://api.github.com/repos/aimacode/aima-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/aimacode/aima-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/aimacode/aima-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/aimacode/aima-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/aimacode/aima-python/contents/{+path}","compare_url":"https://api.github.com/repos/aimacode/aima-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aimacode/aima-python/merges","archive_url":"https://api.github.com/repos/aimacode/aima-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aimacode/aima-python/downloads","issues_url":"https://api.github.com/repos/aimacode/aima-python/issues{/number}","pulls_url":"https://api.github.com/repos/aimacode/aima-python/pulls{/number}","milestones_url":"https://api.github.com/repos/aimacode/aima-python/milestones{/number}","notifications_url":"https://api.github.com/repos/aimacode/aima-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aimacode/aima-python/labels{/name}","releases_url":"https://api.github.com/repos/aimacode/aima-python/releases{/id}","deployments_url":"https://api.github.com/repos/aimacode/aima-python/deployments","created_at":"2016-02-02T00:11:19Z","updated_at":"2018-02-13T19:53:32Z","pushed_at":"2018-02-13T18:26:02Z","git_url":"git://github.com/aimacode/aima-python.git","ssh_url":"git@github.com:aimacode/aima-python.git","clone_url":"https://github.com/aimacode/aima-python.git","svn_url":"https://github.com/aimacode/aima-python","homepage":"","size":8231,"stargazers_count":2411,"watchers_count":2411,"language":"Jupyter Notebook","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":1060,"mirror_url":null,"archived":false,"open_issues_count":54,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1060,"open_issues":54,"watchers":2411,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aimacode/aima-python/pulls/733"},"html":{"href":"https://github.com/aimacode/aima-python/pull/733"},"issue":{"href":"https://api.github.com/repos/aimacode/aima-python/issues/733"},"comments":{"href":"https://api.github.com/repos/aimacode/aima-python/issues/733/comments"},"review_comments":{"href":"https://api.github.com/repos/aimacode/aima-python/pulls/733/comments"},"review_comment":{"href":"https://api.github.com/repos/aimacode/aima-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aimacode/aima-python/pulls/733/commits"},"statuses":{"href":"https://api.github.com/repos/aimacode/aima-python/statuses/0850239b01bf16fb386c46ffda7e62b6ec9c79ed"}},"author_association":"NONE"}}
{"actor":{"display_login":"MrDupin"}}