{"action":"created","comment":{"url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/pulls/comments/28653626","id":28653626,"diff_hunk":"@@ -0,0 +1,159 @@\n+#!/usr/bin/env python\n+# -*- coding: utf-8 -*-\n+\"\"\"week 11 syn module\"\"\"\n+\n+\n+import time\n+\n+\n+class ChessPiece(object):\n+    \"\"\" object of chessPiece class\n+\n+    attribute:\n+        prefix (string): by default, set as an empty string\n+    \"\"\"\n+\n+    prefix = ''\n+\n+    def __init__(self, position):\n+        \"\"\" chessPiece construct\n+        args:\n+            position (string):\n+                stores the tile notation of its current position (eg, 'a8')\n+            moves Lists):\n+                list that stores tuples of information about each move\n+         attributes:\n+            position (string):\n+                stores the tile notation of its current position (eg, 'a8')\n+            moves Lists):\n+                list that stores tuples of information about each move\n+\n+            return:\n+                move(lists):\n+                    lists of the postion of each move\n+            example\n+                >>> piece = ChessPiece('a1')\n+                >>> piece.position\n+                'a1'\n+        \"\"\"\n+\n+        if self.is_legal_move(position):\n+            self.position = position\n+\n+            self.moves = []\n+        else:\n+            excep = '`{}` is not a legal start position'\n+            raise ValueError(excep.format(position))\n+\n+    def algebraic_to_numeric(self, tile):\n+        \"\"\"class function that takes a single string argument, tile, and convert\n+           it to a tuple with two values, a 0-based y-coordinate and a 0-based\n+           x-coordinate\n+\n+        args:\n+            tile(string): string to be converts it to a tuple with two values,\n+                          a 0-based y-coordinate and a 0-based x-coordinate.\n+        attributes:\n+            tile(string): string to be converts it to a tuple with two values,\n+                          a 0-based y-coordinate and a 0-based x-coordinate.\n+        return:\n+            tuples of valid move or none if not invalid\n+        example:\n+            >>> piece.algebraic_to_numeric('e7')\n+            (4,6)\n+            >>> piece.algebraic_to_numeric('j9')\n+            None\n+            >>> piece.move('j9')\n+            False\n+        \"\"\"\n+\n+        newtile = []\n+        algebraicnotation = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']\n+        numericnotation = range(1, 9)\n+\n+        for numeric in numericnotation:\n+            for algebraic in algebraicnotation:\n+                newtile.append(algebraic + str(numeric))\n+        if tile in newtile:\n+            x_cord = algebraicnotation.index(tile[0])\n+            y_cord = numericnotation.index(int(tile[1]))\n+            return x_cord, y_cord\n+        else:\n+            return None\n+\n+    def is_legal_move(self, position):\n+        \"\"\" a fuction that test if the suggested move is a legal move\n+\n+        args:\n+            postion(string): the  algebraic notation of the new position to\n+                             which this piece should be moved\n+            return (bool):\n+                Return True if the move is legal and False if it is not\n+            example:\n+            piece = ChessPiece('e91')\n+            Traceback (most recent call last):\n+            File \"<pyshell#216>\", line 1, in <module>\n+            piece = ChessPiece('e91')\n+            raise ValueError(excep.format(position))\n+            ValueError: `e91` is not a legal start position\n+            example:\n+            >>> piece = ChessPiece('e1')\n+            >>> piece.move('e7')\n+            [('e1', 'e7', 1429395759.478843)]\n+\n+        \"\"\"\n+\n+        if self.algebraic_to_numeric(position) is None:\n+\n+            return False\n+        else:\n+            return True\n+\n+    def move(self, position):\n+        \"\"\"a function to actually move our piece.\n+\n+        args:\n+            the algebraic notation of the new position to be moved.\n+        return:\n+            Return the above tuple is position is a valid move or\n+            If it is not legal, return False\n+        \"\"\"\n+        moves = ()\n+        if self.is_legal_move(position):\n+            oldposition = self.prefix + self.position\n+            newposition = self.prefix + position\n+            \n+            self.moves.append((oldposition, newposition, time.time()))\n+            moves = ((oldposition, newposition, time.time()))","path":"chessmaster.py","position":127,"original_position":127,"commit_id":"e73ff23bc17c265c33019dcc82fc92006a00b2fc","original_commit_id":"e73ff23bc17c265c33019dcc82fc92006a00b2fc","user":{"login":"cheuschober","id":1184479,"avatar_url":"https://avatars.githubusercontent.com/u/1184479?v=3","gravatar_id":"","url":"https://api.github.com/users/cheuschober","html_url":"https://github.com/cheuschober","followers_url":"https://api.github.com/users/cheuschober/followers","following_url":"https://api.github.com/users/cheuschober/following{/other_user}","gists_url":"https://api.github.com/users/cheuschober/gists{/gist_id}","starred_url":"https://api.github.com/users/cheuschober/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cheuschober/subscriptions","organizations_url":"https://api.github.com/users/cheuschober/orgs","repos_url":"https://api.github.com/users/cheuschober/repos","events_url":"https://api.github.com/users/cheuschober/events{/privacy}","received_events_url":"https://api.github.com/users/cheuschober/received_events","type":"User","site_admin":false},"body":"@ayine17 You have a bit of repetition here; switch lines 127 and 126 and you can append the `moves` variable instead.","created_at":"2015-04-19T15:07:19Z","updated_at":"2015-04-19T15:07:19Z","html_url":"https://github.com/is210-2015-spring-01/is210-week-11-synthesizing/pull/4#discussion_r28653626","pull_request_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/pulls/comments/28653626"},"html":{"href":"https://github.com/is210-2015-spring-01/is210-week-11-synthesizing/pull/4#discussion_r28653626"},"pull_request":{"href":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/pulls/4","id":33615223,"html_url":"https://github.com/is210-2015-spring-01/is210-week-11-synthesizing/pull/4","diff_url":"https://github.com/is210-2015-spring-01/is210-week-11-synthesizing/pull/4.diff","patch_url":"https://github.com/is210-2015-spring-01/is210-week-11-synthesizing/pull/4.patch","issue_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/issues/4","number":4,"state":"open","locked":false,"title":"tedsting","user":{"login":"ayine17","id":10751198,"avatar_url":"https://avatars.githubusercontent.com/u/10751198?v=3","gravatar_id":"","url":"https://api.github.com/users/ayine17","html_url":"https://github.com/ayine17","followers_url":"https://api.github.com/users/ayine17/followers","following_url":"https://api.github.com/users/ayine17/following{/other_user}","gists_url":"https://api.github.com/users/ayine17/gists{/gist_id}","starred_url":"https://api.github.com/users/ayine17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayine17/subscriptions","organizations_url":"https://api.github.com/users/ayine17/orgs","repos_url":"https://api.github.com/users/ayine17/repos","events_url":"https://api.github.com/users/ayine17/events{/privacy}","received_events_url":"https://api.github.com/users/ayine17/received_events","type":"User","site_admin":false},"body":"@cheuschober \r\ntask_02 error msg\r\n\r\n>>> rook = Rook('a1')\r\n>>> rook.prefix\r\n'R'\r\n>>> rook.move('b2')\r\nFalse\r\n>>> rook.move('h1')\r\n('Ra1', 'Rh1', 1413252817.89340)\r\n>>> rook.move('h8')\r\ninstead of ('Rh1', 'Rh8', 1413252818.89340), i m getting Rh1, h8,\r\n\r\ni try debugging it but i can't figure out the problem","created_at":"2015-04-19T08:04:08Z","updated_at":"2015-04-19T15:07:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17e11a8cdbe49bd46e7511cde87f36adcb95c405","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/pulls/4/commits","review_comments_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/pulls/4/comments","review_comment_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/issues/4/comments","statuses_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/statuses/e73ff23bc17c265c33019dcc82fc92006a00b2fc","head":{"label":"ayine17:master","ref":"master","sha":"e73ff23bc17c265c33019dcc82fc92006a00b2fc","user":{"login":"ayine17","id":10751198,"avatar_url":"https://avatars.githubusercontent.com/u/10751198?v=3","gravatar_id":"","url":"https://api.github.com/users/ayine17","html_url":"https://github.com/ayine17","followers_url":"https://api.github.com/users/ayine17/followers","following_url":"https://api.github.com/users/ayine17/following{/other_user}","gists_url":"https://api.github.com/users/ayine17/gists{/gist_id}","starred_url":"https://api.github.com/users/ayine17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayine17/subscriptions","organizations_url":"https://api.github.com/users/ayine17/orgs","repos_url":"https://api.github.com/users/ayine17/repos","events_url":"https://api.github.com/users/ayine17/events{/privacy}","received_events_url":"https://api.github.com/users/ayine17/received_events","type":"User","site_admin":false},"repo":{"id":34095950,"name":"is210-week-11-synthesizing","full_name":"ayine17/is210-week-11-synthesizing","owner":{"login":"ayine17","id":10751198,"avatar_url":"https://avatars.githubusercontent.com/u/10751198?v=3","gravatar_id":"","url":"https://api.github.com/users/ayine17","html_url":"https://github.com/ayine17","followers_url":"https://api.github.com/users/ayine17/followers","following_url":"https://api.github.com/users/ayine17/following{/other_user}","gists_url":"https://api.github.com/users/ayine17/gists{/gist_id}","starred_url":"https://api.github.com/users/ayine17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayine17/subscriptions","organizations_url":"https://api.github.com/users/ayine17/orgs","repos_url":"https://api.github.com/users/ayine17/repos","events_url":"https://api.github.com/users/ayine17/events{/privacy}","received_events_url":"https://api.github.com/users/ayine17/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ayine17/is210-week-11-synthesizing","description":"Week #11 Synthesizing Tasks","fork":true,"url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing","forks_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/forks","keys_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/teams","hooks_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/hooks","issue_events_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/issues/events{/number}","events_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/events","assignees_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/assignees{/user}","branches_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/branches{/branch}","tags_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/tags","blobs_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/git/refs{/sha}","trees_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/statuses/{sha}","languages_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/languages","stargazers_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/stargazers","contributors_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/contributors","subscribers_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/subscribers","subscription_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/subscription","commits_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/commits{/sha}","git_commits_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/git/commits{/sha}","comments_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/comments{/number}","issue_comment_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/issues/comments{/number}","contents_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/contents/{+path}","compare_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/merges","archive_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/downloads","issues_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/issues{/number}","pulls_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/pulls{/number}","milestones_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/milestones{/number}","notifications_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/labels{/name}","releases_url":"https://api.github.com/repos/ayine17/is210-week-11-synthesizing/releases{/id}","created_at":"2015-04-17T04:11:39Z","updated_at":"2015-04-19T07:47:35Z","pushed_at":"2015-04-19T07:47:35Z","git_url":"git://github.com/ayine17/is210-week-11-synthesizing.git","ssh_url":"git@github.com:ayine17/is210-week-11-synthesizing.git","clone_url":"https://github.com/ayine17/is210-week-11-synthesizing.git","svn_url":"https://github.com/ayine17/is210-week-11-synthesizing","homepage":null,"size":156,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"is210-2015-spring-01:ayine17","ref":"ayine17","sha":"64bd8f022c52f9c9d43e40ed5d9ccbd4e206685e","user":{"login":"is210-2015-spring-01","id":10734022,"avatar_url":"https://avatars.githubusercontent.com/u/10734022?v=3","gravatar_id":"","url":"https://api.github.com/users/is210-2015-spring-01","html_url":"https://github.com/is210-2015-spring-01","followers_url":"https://api.github.com/users/is210-2015-spring-01/followers","following_url":"https://api.github.com/users/is210-2015-spring-01/following{/other_user}","gists_url":"https://api.github.com/users/is210-2015-spring-01/gists{/gist_id}","starred_url":"https://api.github.com/users/is210-2015-spring-01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/is210-2015-spring-01/subscriptions","organizations_url":"https://api.github.com/users/is210-2015-spring-01/orgs","repos_url":"https://api.github.com/users/is210-2015-spring-01/repos","events_url":"https://api.github.com/users/is210-2015-spring-01/events{/privacy}","received_events_url":"https://api.github.com/users/is210-2015-spring-01/received_events","type":"Organization","site_admin":false},"repo":{"id":33843602,"name":"is210-week-11-synthesizing","full_name":"is210-2015-spring-01/is210-week-11-synthesizing","owner":{"login":"is210-2015-spring-01","id":10734022,"avatar_url":"https://avatars.githubusercontent.com/u/10734022?v=3","gravatar_id":"","url":"https://api.github.com/users/is210-2015-spring-01","html_url":"https://github.com/is210-2015-spring-01","followers_url":"https://api.github.com/users/is210-2015-spring-01/followers","following_url":"https://api.github.com/users/is210-2015-spring-01/following{/other_user}","gists_url":"https://api.github.com/users/is210-2015-spring-01/gists{/gist_id}","starred_url":"https://api.github.com/users/is210-2015-spring-01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/is210-2015-spring-01/subscriptions","organizations_url":"https://api.github.com/users/is210-2015-spring-01/orgs","repos_url":"https://api.github.com/users/is210-2015-spring-01/repos","events_url":"https://api.github.com/users/is210-2015-spring-01/events{/privacy}","received_events_url":"https://api.github.com/users/is210-2015-spring-01/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/is210-2015-spring-01/is210-week-11-synthesizing","description":"Week #11 Synthesizing Tasks","fork":true,"url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing","forks_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/forks","keys_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/teams","hooks_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/hooks","issue_events_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/issues/events{/number}","events_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/events","assignees_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/assignees{/user}","branches_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/branches{/branch}","tags_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/tags","blobs_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/git/refs{/sha}","trees_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/statuses/{sha}","languages_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/languages","stargazers_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/stargazers","contributors_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/contributors","subscribers_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/subscribers","subscription_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/subscription","commits_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/commits{/sha}","git_commits_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/git/commits{/sha}","comments_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/comments{/number}","issue_comment_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/issues/comments{/number}","contents_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/contents/{+path}","compare_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/merges","archive_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/downloads","issues_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/issues{/number}","pulls_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/pulls{/number}","milestones_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/milestones{/number}","notifications_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/labels{/name}","releases_url":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/releases{/id}","created_at":"2015-04-13T02:28:48Z","updated_at":"2015-04-13T03:08:49Z","pushed_at":"2015-04-19T08:04:08Z","git_url":"git://github.com/is210-2015-spring-01/is210-week-11-synthesizing.git","ssh_url":"git@github.com:is210-2015-spring-01/is210-week-11-synthesizing.git","clone_url":"https://github.com/is210-2015-spring-01/is210-week-11-synthesizing.git","svn_url":"https://github.com/is210-2015-spring-01/is210-week-11-synthesizing","homepage":null,"size":156,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":4,"forks":9,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/pulls/4"},"html":{"href":"https://github.com/is210-2015-spring-01/is210-week-11-synthesizing/pull/4"},"issue":{"href":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/issues/4"},"comments":{"href":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/is210-2015-spring-01/is210-week-11-synthesizing/statuses/e73ff23bc17c265c33019dcc82fc92006a00b2fc"}}}}