{"action":"created","comment":{"url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/pulls/comments/28475438","id":28475438,"diff_hunk":"@@ -0,0 +1,184 @@\n+from string import maketrans\n+\n+class Backtracking(object):\n+    def __init__(self):\n+        self.UNASSIGNED = 0\n+        self.DIMENSION = 9\n+\n+    def find_unassigned_location(self, grid, row, col):\n+        \"\"\" Function that returns the possition of a cell with the value \n+        self.UNASSIGNED\n+\n+        int[9][9] grid -- the grid with the current sudoku values.\n+        int row -- row number in the grid.\n+        int col -- column number in the grid.\n+        return array[2]: position with the UNASSIGNED value or None in the case that\n+            the grid is already filled.\n+        \"\"\"\n+\n+        for row in range(len(grid)):\n+            position = self.find_unassigned_cell_by_row(grid, row, col)\n+            if position is not None:\n+                return position\n+        return None\n+\n+    def find_unassigned_cell_by_row(self, grid, row, col):\n+        \"\"\" This method return the cell that is unfilled by a row.\n+\n+        int[9][9] grid -- the grid with the current sudoku game.\n+        int row -- The current row to check the self.UNASSIGNED position\n+        int col -- The current col to check the self.UNASSIGNED position\n+        return int[2] -- return an array with a size of 2 that is the position \n+            [row, col] af a sel with self.UNASSIGNED status.\n+        \"\"\"\n+        for col in range(len(grid[row])):\n+            if grid[row][col] == self.UNASSIGNED:\n+                return [row, col]\n+        return None\n+        \n+    def is_used_in_row(self, grid, row, num):\n+        \"\"\"Function that returns a boolean value when the *num* provided is repeated\n+        in the row.\n+\n+        int[9][9] grid -- the grid with the current sudoku values.\n+        int row -- row number in the grid.\n+        int num -- number to eval in the row.\n+        return boolean -- return True when is already used in the row or False when\n+            is not used.    \n+        \"\"\"\n+        for col in range(len(grid[row])):\n+            if grid[row][col] == num:\n+                return True;\n+        return False\n+    \n+    def is_used_in_col(self, grid, col, num):\n+        \"\"\" Function that returns a boolean value when the *num* provided is\n+        repeated in the column.\n+\n+        int[9][9] grid -- the grid with the current sudoku values.\n+        int col -- column number in the grid.\n+        int num -- number to eval in the col.\n+        return boolean -- return True when is already used in the column or False \n+            when is not used.\n+        \"\"\"\n+        for row in range(len(grid)):\n+            if grid[row][col] == num:\n+                return True;\n+        return False\n+    \n+    def is_used_in_box(self, grid, box_start_row, box_start_col, num):\n+        \"\"\" Function that returns a boolean value when the *num* provided is \n+        repeated in a box 3x3.\n+\n+        int[9][9] grid -- the grid with the current sudoku values.\n+        int box_start_row -- row number in the grid where the box 3x3 starts.\n+        int box_start_col -- column number in the grid where the box 3x3 starts\n+        int num -- number to eval in the box.","path":"src/algorithms/backtracking.py","position":76,"original_position":76,"commit_id":"982b6ae0a0be152d416f700839108fa92c73e0c6","original_commit_id":"982b6ae0a0be152d416f700839108fa92c73e0c6","user":{"login":"edson-gonzales","id":4943497,"avatar_url":"https://avatars.githubusercontent.com/u/4943497?v=3","gravatar_id":"","url":"https://api.github.com/users/edson-gonzales","html_url":"https://github.com/edson-gonzales","followers_url":"https://api.github.com/users/edson-gonzales/followers","following_url":"https://api.github.com/users/edson-gonzales/following{/other_user}","gists_url":"https://api.github.com/users/edson-gonzales/gists{/gist_id}","starred_url":"https://api.github.com/users/edson-gonzales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edson-gonzales/subscriptions","organizations_url":"https://api.github.com/users/edson-gonzales/orgs","repos_url":"https://api.github.com/users/edson-gonzales/repos","events_url":"https://api.github.com/users/edson-gonzales/events{/privacy}","received_events_url":"https://api.github.com/users/edson-gonzales/received_events","type":"User","site_admin":false},"body":"what is eval?","created_at":"2015-04-16T00:17:47Z","updated_at":"2015-04-16T00:17:47Z","html_url":"https://github.com/edson-gonzales/sudoku2015-B/pull/26#discussion_r28475438","pull_request_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/pulls/comments/28475438"},"html":{"href":"https://github.com/edson-gonzales/sudoku2015-B/pull/26#discussion_r28475438"},"pull_request":{"href":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/pulls/26","id":33403813,"html_url":"https://github.com/edson-gonzales/sudoku2015-B/pull/26","diff_url":"https://github.com/edson-gonzales/sudoku2015-B/pull/26.diff","patch_url":"https://github.com/edson-gonzales/sudoku2015-B/pull/26.patch","issue_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/issues/26","number":26,"state":"open","locked":false,"title":"Bactrackingimp","user":{"login":"ccatari","id":11655420,"avatar_url":"https://avatars.githubusercontent.com/u/11655420?v=3","gravatar_id":"","url":"https://api.github.com/users/ccatari","html_url":"https://github.com/ccatari","followers_url":"https://api.github.com/users/ccatari/followers","following_url":"https://api.github.com/users/ccatari/following{/other_user}","gists_url":"https://api.github.com/users/ccatari/gists{/gist_id}","starred_url":"https://api.github.com/users/ccatari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccatari/subscriptions","organizations_url":"https://api.github.com/users/ccatari/orgs","repos_url":"https://api.github.com/users/ccatari/repos","events_url":"https://api.github.com/users/ccatari/events{/privacy}","received_events_url":"https://api.github.com/users/ccatari/received_events","type":"User","site_admin":false},"body":"It was completed the implementation of the backtracking algorithm and it was added documentation by method included the unit test cases.\r\nupdated indentations to spaces\r\nupdated return of methods\r\nupdated spaces","created_at":"2015-04-15T22:41:30Z","updated_at":"2015-04-16T00:17:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7938653d4c994650db3609299019e353957d753","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/pulls/26/commits","review_comments_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/pulls/26/comments","review_comment_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/issues/26/comments","statuses_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/statuses/982b6ae0a0be152d416f700839108fa92c73e0c6","head":{"label":"edson-gonzales:BactrackingImp","ref":"BactrackingImp","sha":"982b6ae0a0be152d416f700839108fa92c73e0c6","user":{"login":"edson-gonzales","id":4943497,"avatar_url":"https://avatars.githubusercontent.com/u/4943497?v=3","gravatar_id":"","url":"https://api.github.com/users/edson-gonzales","html_url":"https://github.com/edson-gonzales","followers_url":"https://api.github.com/users/edson-gonzales/followers","following_url":"https://api.github.com/users/edson-gonzales/following{/other_user}","gists_url":"https://api.github.com/users/edson-gonzales/gists{/gist_id}","starred_url":"https://api.github.com/users/edson-gonzales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edson-gonzales/subscriptions","organizations_url":"https://api.github.com/users/edson-gonzales/orgs","repos_url":"https://api.github.com/users/edson-gonzales/repos","events_url":"https://api.github.com/users/edson-gonzales/events{/privacy}","received_events_url":"https://api.github.com/users/edson-gonzales/received_events","type":"User","site_admin":false},"repo":{"id":32960008,"name":"sudoku2015-B","full_name":"edson-gonzales/sudoku2015-B","owner":{"login":"edson-gonzales","id":4943497,"avatar_url":"https://avatars.githubusercontent.com/u/4943497?v=3","gravatar_id":"","url":"https://api.github.com/users/edson-gonzales","html_url":"https://github.com/edson-gonzales","followers_url":"https://api.github.com/users/edson-gonzales/followers","following_url":"https://api.github.com/users/edson-gonzales/following{/other_user}","gists_url":"https://api.github.com/users/edson-gonzales/gists{/gist_id}","starred_url":"https://api.github.com/users/edson-gonzales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edson-gonzales/subscriptions","organizations_url":"https://api.github.com/users/edson-gonzales/orgs","repos_url":"https://api.github.com/users/edson-gonzales/repos","events_url":"https://api.github.com/users/edson-gonzales/events{/privacy}","received_events_url":"https://api.github.com/users/edson-gonzales/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/edson-gonzales/sudoku2015-B","description":"","fork":false,"url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B","forks_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/forks","keys_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/teams","hooks_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/hooks","issue_events_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/issues/events{/number}","events_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/events","assignees_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/assignees{/user}","branches_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/branches{/branch}","tags_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/tags","blobs_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/git/refs{/sha}","trees_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/statuses/{sha}","languages_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/languages","stargazers_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/stargazers","contributors_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/contributors","subscribers_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/subscribers","subscription_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/subscription","commits_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/commits{/sha}","git_commits_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/git/commits{/sha}","comments_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/comments{/number}","issue_comment_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/issues/comments{/number}","contents_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/contents/{+path}","compare_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/merges","archive_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/downloads","issues_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/issues{/number}","pulls_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/pulls{/number}","milestones_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/milestones{/number}","notifications_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/labels{/name}","releases_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/releases{/id}","created_at":"2015-03-27T00:49:55Z","updated_at":"2015-03-27T00:49:55Z","pushed_at":"2015-04-15T22:41:30Z","git_url":"git://github.com/edson-gonzales/sudoku2015-B.git","ssh_url":"git@github.com:edson-gonzales/sudoku2015-B.git","clone_url":"https://github.com/edson-gonzales/sudoku2015-B.git","svn_url":"https://github.com/edson-gonzales/sudoku2015-B","homepage":null,"size":248,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"edson-gonzales:master","ref":"master","sha":"ccc97bdf3a7de8b5cad4b1a47a207af2ff427c71","user":{"login":"edson-gonzales","id":4943497,"avatar_url":"https://avatars.githubusercontent.com/u/4943497?v=3","gravatar_id":"","url":"https://api.github.com/users/edson-gonzales","html_url":"https://github.com/edson-gonzales","followers_url":"https://api.github.com/users/edson-gonzales/followers","following_url":"https://api.github.com/users/edson-gonzales/following{/other_user}","gists_url":"https://api.github.com/users/edson-gonzales/gists{/gist_id}","starred_url":"https://api.github.com/users/edson-gonzales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edson-gonzales/subscriptions","organizations_url":"https://api.github.com/users/edson-gonzales/orgs","repos_url":"https://api.github.com/users/edson-gonzales/repos","events_url":"https://api.github.com/users/edson-gonzales/events{/privacy}","received_events_url":"https://api.github.com/users/edson-gonzales/received_events","type":"User","site_admin":false},"repo":{"id":32960008,"name":"sudoku2015-B","full_name":"edson-gonzales/sudoku2015-B","owner":{"login":"edson-gonzales","id":4943497,"avatar_url":"https://avatars.githubusercontent.com/u/4943497?v=3","gravatar_id":"","url":"https://api.github.com/users/edson-gonzales","html_url":"https://github.com/edson-gonzales","followers_url":"https://api.github.com/users/edson-gonzales/followers","following_url":"https://api.github.com/users/edson-gonzales/following{/other_user}","gists_url":"https://api.github.com/users/edson-gonzales/gists{/gist_id}","starred_url":"https://api.github.com/users/edson-gonzales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edson-gonzales/subscriptions","organizations_url":"https://api.github.com/users/edson-gonzales/orgs","repos_url":"https://api.github.com/users/edson-gonzales/repos","events_url":"https://api.github.com/users/edson-gonzales/events{/privacy}","received_events_url":"https://api.github.com/users/edson-gonzales/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/edson-gonzales/sudoku2015-B","description":"","fork":false,"url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B","forks_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/forks","keys_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/teams","hooks_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/hooks","issue_events_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/issues/events{/number}","events_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/events","assignees_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/assignees{/user}","branches_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/branches{/branch}","tags_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/tags","blobs_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/git/refs{/sha}","trees_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/statuses/{sha}","languages_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/languages","stargazers_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/stargazers","contributors_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/contributors","subscribers_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/subscribers","subscription_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/subscription","commits_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/commits{/sha}","git_commits_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/git/commits{/sha}","comments_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/comments{/number}","issue_comment_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/issues/comments{/number}","contents_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/contents/{+path}","compare_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/merges","archive_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/downloads","issues_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/issues{/number}","pulls_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/pulls{/number}","milestones_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/milestones{/number}","notifications_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/labels{/name}","releases_url":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/releases{/id}","created_at":"2015-03-27T00:49:55Z","updated_at":"2015-03-27T00:49:55Z","pushed_at":"2015-04-15T22:41:30Z","git_url":"git://github.com/edson-gonzales/sudoku2015-B.git","ssh_url":"git@github.com:edson-gonzales/sudoku2015-B.git","clone_url":"https://github.com/edson-gonzales/sudoku2015-B.git","svn_url":"https://github.com/edson-gonzales/sudoku2015-B","homepage":null,"size":248,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/pulls/26"},"html":{"href":"https://github.com/edson-gonzales/sudoku2015-B/pull/26"},"issue":{"href":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/issues/26"},"comments":{"href":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/edson-gonzales/sudoku2015-B/statuses/982b6ae0a0be152d416f700839108fa92c73e0c6"}}}}