{"action":"created","comment":{"url":"https://api.github.com/repos/Axelrod-Python/Axelrod/pulls/comments/52924426","id":52924426,"diff_hunk":"@@ -0,0 +1,60 @@\n+from axelrod import Actions, Player\n+\n+class ThueMorse(Player):\n+    \"\"\"A player who cooperates or defects according to the Thue-Morse sequence.\"\"\"\n+\n+    name = 'ThueMorse'\n+    classifier = {\n+        'memory_depth': float('Inf'),\n+        'stochastic': False,\n+        'makes_use_of': set(),\n+        'inspects_source': False,\n+        'manipulates_source': False,\n+        'manipulates_state': False\n+    }\n+\n+    def thuemorse_sequence(self, x):\n+\t    if x == 0:\n+\t        return 0\n+\t    if x%2==0:\n+\t        return self.thuemorse_sequence(x/2)\n+\t    if x%2==1:\n+\t        f = x-1\n+\t        return 1 - self.thuemorse_sequence(f/2)\n+\n+    def strategy(self, opponent):\n+        n = len(self.history)\n+        if self.thuemorse_sequence(n) == 1:\n+            return Actions.C\n+        return Actions.D\n+\n+\n+\n+\n+class ThueMorseInverse(Player):\n+    \"\"\"A player who defects or cooperates according to the Thue-Morse sequence (Inverse of ThueMorse).\"\"\"\n+\n+    name = 'ThueMorseInverse'\n+    classifier = {\n+        'memory_depth': float('Inf'),\n+        'stochastic': False,\n+        'makes_use_of': set(),\n+        'inspects_source': False,\n+        'manipulates_source': False,\n+        'manipulates_state': False\n+    }\n+\n+    def thuemorse_sequence(self, x):\n+\t    if x == 0:\n+\t        return 0\n+\t    if x%2==0:","path":"axelrod/strategies/thuemorse.py","position":50,"original_position":50,"commit_id":"83f0dda3596343cab895d9bbd9960b49dc355229","original_commit_id":"83f0dda3596343cab895d9bbd9960b49dc355229","user":{"login":"drvinceknight","id":2131546,"avatar_url":"https://avatars.githubusercontent.com/u/2131546?v=3","gravatar_id":"","url":"https://api.github.com/users/drvinceknight","html_url":"https://github.com/drvinceknight","followers_url":"https://api.github.com/users/drvinceknight/followers","following_url":"https://api.github.com/users/drvinceknight/following{/other_user}","gists_url":"https://api.github.com/users/drvinceknight/gists{/gist_id}","starred_url":"https://api.github.com/users/drvinceknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drvinceknight/subscriptions","organizations_url":"https://api.github.com/users/drvinceknight/orgs","repos_url":"https://api.github.com/users/drvinceknight/repos","events_url":"https://api.github.com/users/drvinceknight/events{/privacy}","received_events_url":"https://api.github.com/users/drvinceknight/received_events","type":"User","site_admin":false},"body":"PEP8","created_at":"2016-02-15T17:20:43Z","updated_at":"2016-02-15T17:20:43Z","html_url":"https://github.com/Axelrod-Python/Axelrod/pull/460#discussion_r52924426","pull_request_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/pulls/460","_links":{"self":{"href":"https://api.github.com/repos/Axelrod-Python/Axelrod/pulls/comments/52924426"},"html":{"href":"https://github.com/Axelrod-Python/Axelrod/pull/460#discussion_r52924426"},"pull_request":{"href":"https://api.github.com/repos/Axelrod-Python/Axelrod/pulls/460"}}},"pull_request":{"url":"https://api.github.com/repos/Axelrod-Python/Axelrod/pulls/460","id":59391025,"html_url":"https://github.com/Axelrod-Python/Axelrod/pull/460","diff_url":"https://github.com/Axelrod-Python/Axelrod/pull/460.diff","patch_url":"https://github.com/Axelrod-Python/Axelrod/pull/460.patch","issue_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/issues/460","number":460,"state":"open","locked":false,"title":"Adding ThueMorse and ThueMorseInverse strategies","user":{"login":"geraintpalmer","id":9679702,"avatar_url":"https://avatars.githubusercontent.com/u/9679702?v=3","gravatar_id":"","url":"https://api.github.com/users/geraintpalmer","html_url":"https://github.com/geraintpalmer","followers_url":"https://api.github.com/users/geraintpalmer/followers","following_url":"https://api.github.com/users/geraintpalmer/following{/other_user}","gists_url":"https://api.github.com/users/geraintpalmer/gists{/gist_id}","starred_url":"https://api.github.com/users/geraintpalmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geraintpalmer/subscriptions","organizations_url":"https://api.github.com/users/geraintpalmer/orgs","repos_url":"https://api.github.com/users/geraintpalmer/repos","events_url":"https://api.github.com/users/geraintpalmer/events{/privacy}","received_events_url":"https://api.github.com/users/geraintpalmer/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-15T17:09:13Z","updated_at":"2016-02-15T17:20:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9fd25ffe10b99650d89806674ee360722fd3f94","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/pulls/460/commits","review_comments_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/pulls/460/comments","review_comment_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/issues/460/comments","statuses_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/statuses/83f0dda3596343cab895d9bbd9960b49dc355229","head":{"label":"geraintpalmer:master","ref":"master","sha":"83f0dda3596343cab895d9bbd9960b49dc355229","user":{"login":"geraintpalmer","id":9679702,"avatar_url":"https://avatars.githubusercontent.com/u/9679702?v=3","gravatar_id":"","url":"https://api.github.com/users/geraintpalmer","html_url":"https://github.com/geraintpalmer","followers_url":"https://api.github.com/users/geraintpalmer/followers","following_url":"https://api.github.com/users/geraintpalmer/following{/other_user}","gists_url":"https://api.github.com/users/geraintpalmer/gists{/gist_id}","starred_url":"https://api.github.com/users/geraintpalmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geraintpalmer/subscriptions","organizations_url":"https://api.github.com/users/geraintpalmer/orgs","repos_url":"https://api.github.com/users/geraintpalmer/repos","events_url":"https://api.github.com/users/geraintpalmer/events{/privacy}","received_events_url":"https://api.github.com/users/geraintpalmer/received_events","type":"User","site_admin":false},"repo":{"id":30966966,"name":"Axelrod","full_name":"geraintpalmer/Axelrod","owner":{"login":"geraintpalmer","id":9679702,"avatar_url":"https://avatars.githubusercontent.com/u/9679702?v=3","gravatar_id":"","url":"https://api.github.com/users/geraintpalmer","html_url":"https://github.com/geraintpalmer","followers_url":"https://api.github.com/users/geraintpalmer/followers","following_url":"https://api.github.com/users/geraintpalmer/following{/other_user}","gists_url":"https://api.github.com/users/geraintpalmer/gists{/gist_id}","starred_url":"https://api.github.com/users/geraintpalmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geraintpalmer/subscriptions","organizations_url":"https://api.github.com/users/geraintpalmer/orgs","repos_url":"https://api.github.com/users/geraintpalmer/repos","events_url":"https://api.github.com/users/geraintpalmer/events{/privacy}","received_events_url":"https://api.github.com/users/geraintpalmer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/geraintpalmer/Axelrod","description":"A repository used to reproduce Axelrod's tournament","fork":true,"url":"https://api.github.com/repos/geraintpalmer/Axelrod","forks_url":"https://api.github.com/repos/geraintpalmer/Axelrod/forks","keys_url":"https://api.github.com/repos/geraintpalmer/Axelrod/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geraintpalmer/Axelrod/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geraintpalmer/Axelrod/teams","hooks_url":"https://api.github.com/repos/geraintpalmer/Axelrod/hooks","issue_events_url":"https://api.github.com/repos/geraintpalmer/Axelrod/issues/events{/number}","events_url":"https://api.github.com/repos/geraintpalmer/Axelrod/events","assignees_url":"https://api.github.com/repos/geraintpalmer/Axelrod/assignees{/user}","branches_url":"https://api.github.com/repos/geraintpalmer/Axelrod/branches{/branch}","tags_url":"https://api.github.com/repos/geraintpalmer/Axelrod/tags","blobs_url":"https://api.github.com/repos/geraintpalmer/Axelrod/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geraintpalmer/Axelrod/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geraintpalmer/Axelrod/git/refs{/sha}","trees_url":"https://api.github.com/repos/geraintpalmer/Axelrod/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geraintpalmer/Axelrod/statuses/{sha}","languages_url":"https://api.github.com/repos/geraintpalmer/Axelrod/languages","stargazers_url":"https://api.github.com/repos/geraintpalmer/Axelrod/stargazers","contributors_url":"https://api.github.com/repos/geraintpalmer/Axelrod/contributors","subscribers_url":"https://api.github.com/repos/geraintpalmer/Axelrod/subscribers","subscription_url":"https://api.github.com/repos/geraintpalmer/Axelrod/subscription","commits_url":"https://api.github.com/repos/geraintpalmer/Axelrod/commits{/sha}","git_commits_url":"https://api.github.com/repos/geraintpalmer/Axelrod/git/commits{/sha}","comments_url":"https://api.github.com/repos/geraintpalmer/Axelrod/comments{/number}","issue_comment_url":"https://api.github.com/repos/geraintpalmer/Axelrod/issues/comments{/number}","contents_url":"https://api.github.com/repos/geraintpalmer/Axelrod/contents/{+path}","compare_url":"https://api.github.com/repos/geraintpalmer/Axelrod/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geraintpalmer/Axelrod/merges","archive_url":"https://api.github.com/repos/geraintpalmer/Axelrod/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geraintpalmer/Axelrod/downloads","issues_url":"https://api.github.com/repos/geraintpalmer/Axelrod/issues{/number}","pulls_url":"https://api.github.com/repos/geraintpalmer/Axelrod/pulls{/number}","milestones_url":"https://api.github.com/repos/geraintpalmer/Axelrod/milestones{/number}","notifications_url":"https://api.github.com/repos/geraintpalmer/Axelrod/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geraintpalmer/Axelrod/labels{/name}","releases_url":"https://api.github.com/repos/geraintpalmer/Axelrod/releases{/id}","deployments_url":"https://api.github.com/repos/geraintpalmer/Axelrod/deployments","created_at":"2015-02-18T13:40:56Z","updated_at":"2016-02-15T11:51:57Z","pushed_at":"2016-02-15T17:08:12Z","git_url":"git://github.com/geraintpalmer/Axelrod.git","ssh_url":"git@github.com:geraintpalmer/Axelrod.git","clone_url":"https://github.com/geraintpalmer/Axelrod.git","svn_url":"https://github.com/geraintpalmer/Axelrod","homepage":null,"size":134737,"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":"Axelrod-Python:master","ref":"master","sha":"758a4e7cb6880ca24d9dc2b6c8c5c04da38cb269","user":{"login":"Axelrod-Python","id":11720937,"avatar_url":"https://avatars.githubusercontent.com/u/11720937?v=3","gravatar_id":"","url":"https://api.github.com/users/Axelrod-Python","html_url":"https://github.com/Axelrod-Python","followers_url":"https://api.github.com/users/Axelrod-Python/followers","following_url":"https://api.github.com/users/Axelrod-Python/following{/other_user}","gists_url":"https://api.github.com/users/Axelrod-Python/gists{/gist_id}","starred_url":"https://api.github.com/users/Axelrod-Python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Axelrod-Python/subscriptions","organizations_url":"https://api.github.com/users/Axelrod-Python/orgs","repos_url":"https://api.github.com/users/Axelrod-Python/repos","events_url":"https://api.github.com/users/Axelrod-Python/events{/privacy}","received_events_url":"https://api.github.com/users/Axelrod-Python/received_events","type":"Organization","site_admin":false},"repo":{"id":30959449,"name":"Axelrod","full_name":"Axelrod-Python/Axelrod","owner":{"login":"Axelrod-Python","id":11720937,"avatar_url":"https://avatars.githubusercontent.com/u/11720937?v=3","gravatar_id":"","url":"https://api.github.com/users/Axelrod-Python","html_url":"https://github.com/Axelrod-Python","followers_url":"https://api.github.com/users/Axelrod-Python/followers","following_url":"https://api.github.com/users/Axelrod-Python/following{/other_user}","gists_url":"https://api.github.com/users/Axelrod-Python/gists{/gist_id}","starred_url":"https://api.github.com/users/Axelrod-Python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Axelrod-Python/subscriptions","organizations_url":"https://api.github.com/users/Axelrod-Python/orgs","repos_url":"https://api.github.com/users/Axelrod-Python/repos","events_url":"https://api.github.com/users/Axelrod-Python/events{/privacy}","received_events_url":"https://api.github.com/users/Axelrod-Python/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Axelrod-Python/Axelrod","description":"A library to run Iterated Prisoner's Dilemma tournaments","fork":false,"url":"https://api.github.com/repos/Axelrod-Python/Axelrod","forks_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/forks","keys_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/teams","hooks_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/hooks","issue_events_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/issues/events{/number}","events_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/events","assignees_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/assignees{/user}","branches_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/branches{/branch}","tags_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/tags","blobs_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/git/refs{/sha}","trees_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/statuses/{sha}","languages_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/languages","stargazers_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/stargazers","contributors_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/contributors","subscribers_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/subscribers","subscription_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/subscription","commits_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/commits{/sha}","git_commits_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/git/commits{/sha}","comments_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/comments{/number}","issue_comment_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/issues/comments{/number}","contents_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/contents/{+path}","compare_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/merges","archive_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/downloads","issues_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/issues{/number}","pulls_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/pulls{/number}","milestones_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/milestones{/number}","notifications_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/labels{/name}","releases_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/releases{/id}","deployments_url":"https://api.github.com/repos/Axelrod-Python/Axelrod/deployments","created_at":"2015-02-18T09:37:17Z","updated_at":"2016-01-17T21:06:05Z","pushed_at":"2016-02-15T17:09:13Z","git_url":"git://github.com/Axelrod-Python/Axelrod.git","ssh_url":"git@github.com:Axelrod-Python/Axelrod.git","clone_url":"https://github.com/Axelrod-Python/Axelrod.git","svn_url":"https://github.com/Axelrod-Python/Axelrod","homepage":"http://axelrod.readthedocs.org/","size":136338,"stargazers_count":56,"watchers_count":56,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":27,"forks":44,"open_issues":27,"watchers":56,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Axelrod-Python/Axelrod/pulls/460"},"html":{"href":"https://github.com/Axelrod-Python/Axelrod/pull/460"},"issue":{"href":"https://api.github.com/repos/Axelrod-Python/Axelrod/issues/460"},"comments":{"href":"https://api.github.com/repos/Axelrod-Python/Axelrod/issues/460/comments"},"review_comments":{"href":"https://api.github.com/repos/Axelrod-Python/Axelrod/pulls/460/comments"},"review_comment":{"href":"https://api.github.com/repos/Axelrod-Python/Axelrod/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Axelrod-Python/Axelrod/pulls/460/commits"},"statuses":{"href":"https://api.github.com/repos/Axelrod-Python/Axelrod/statuses/83f0dda3596343cab895d9bbd9960b49dc355229"}}}}