{"action":"created","comment":{"url":"https://api.github.com/repos/Raskerov/RspecChallenges/pulls/comments/71309879","id":71309879,"diff_hunk":"@@ -0,0 +1,34 @@\n+class Knight\n+  attr_reader :x, :y\n+  ASCII_TRANSLATION = 96\n+\n+  def initialize(x, y)\n+    @x = x.ord - ASCII_TRANSLATION\n+    @y = y\n+  end\n+\n+  def move\n+    avaiable_positions\n+  end\n+\n+  private\n+\n+  VECTORS = [[-2, -1], [-2, +1], [-1, -2], [-1, +2], [+1, -2], [+1, +2], [+2, -1], [+2, +1]].freeze\n+  SCOPE = (1..8)\n+\n+  def avaiable_positions\n+    new_positions.map { |a| (a.first + ASCII_TRANSLATION).chr + a.last.to_s }","path":"lib/knight_moves.rb","position":20,"original_position":20,"commit_id":"fbd4c1066a0a8b124f5dbe8819d3cdf88571803e","original_commit_id":"fbd4c1066a0a8b124f5dbe8819d3cdf88571803e","user":{"login":"cs3b","id":120829,"avatar_url":"https://avatars.githubusercontent.com/u/120829?v=3","gravatar_id":"","url":"https://api.github.com/users/cs3b","html_url":"https://github.com/cs3b","followers_url":"https://api.github.com/users/cs3b/followers","following_url":"https://api.github.com/users/cs3b/following{/other_user}","gists_url":"https://api.github.com/users/cs3b/gists{/gist_id}","starred_url":"https://api.github.com/users/cs3b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cs3b/subscriptions","organizations_url":"https://api.github.com/users/cs3b/orgs","repos_url":"https://api.github.com/users/cs3b/repos","events_url":"https://api.github.com/users/cs3b/events{/privacy}","received_events_url":"https://api.github.com/users/cs3b/received_events","type":"User","site_admin":false},"body":"you can also write it\r\n\r\n```ruby\r\nnew_positions.map { |possible_x, possible_y| (possible_x + ASCII_TRANSLATION).chr + possible_y.to_s }\r\n```\r\n\r\nstill going further, you can also do it like\r\n\r\n```ruby\r\ndef  available_positions\r\n  new_positions.map(&method(:translate_to_coordinates))\r\nend\r\n\r\ndef translate_to_coordinates(position)\r\n   _x, _y = *position\r\n  (_x + ASCII_TRANSLATION).chr + _y.to_s\r\nend\r\n```","created_at":"2016-07-19T10:10:37Z","updated_at":"2016-07-19T10:10:37Z","html_url":"https://github.com/Raskerov/RspecChallenges/pull/1#discussion_r71309879","pull_request_url":"https://api.github.com/repos/Raskerov/RspecChallenges/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/Raskerov/RspecChallenges/pulls/comments/71309879"},"html":{"href":"https://github.com/Raskerov/RspecChallenges/pull/1#discussion_r71309879"},"pull_request":{"href":"https://api.github.com/repos/Raskerov/RspecChallenges/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Raskerov/RspecChallenges/pulls/1","id":77948938,"html_url":"https://github.com/Raskerov/RspecChallenges/pull/1","diff_url":"https://github.com/Raskerov/RspecChallenges/pull/1.diff","patch_url":"https://github.com/Raskerov/RspecChallenges/pull/1.patch","issue_url":"https://api.github.com/repos/Raskerov/RspecChallenges/issues/1","number":1,"state":"open","locked":false,"title":"Knight moves","user":{"login":"cs3b","id":120829,"avatar_url":"https://avatars.githubusercontent.com/u/120829?v=3","gravatar_id":"","url":"https://api.github.com/users/cs3b","html_url":"https://github.com/cs3b","followers_url":"https://api.github.com/users/cs3b/followers","following_url":"https://api.github.com/users/cs3b/following{/other_user}","gists_url":"https://api.github.com/users/cs3b/gists{/gist_id}","starred_url":"https://api.github.com/users/cs3b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cs3b/subscriptions","organizations_url":"https://api.github.com/users/cs3b/orgs","repos_url":"https://api.github.com/users/cs3b/repos","events_url":"https://api.github.com/users/cs3b/events{/privacy}","received_events_url":"https://api.github.com/users/cs3b/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-19T10:02:06Z","updated_at":"2016-07-19T10:10:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c62ddcb469633dd537a9628024549271ea2192a6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Raskerov/RspecChallenges/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Raskerov/RspecChallenges/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Raskerov/RspecChallenges/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Raskerov/RspecChallenges/issues/1/comments","statuses_url":"https://api.github.com/repos/Raskerov/RspecChallenges/statuses/fbd4c1066a0a8b124f5dbe8819d3cdf88571803e","head":{"label":"Raskerov:knight_moves","ref":"knight_moves","sha":"fbd4c1066a0a8b124f5dbe8819d3cdf88571803e","user":{"login":"Raskerov","id":17760319,"avatar_url":"https://avatars.githubusercontent.com/u/17760319?v=3","gravatar_id":"","url":"https://api.github.com/users/Raskerov","html_url":"https://github.com/Raskerov","followers_url":"https://api.github.com/users/Raskerov/followers","following_url":"https://api.github.com/users/Raskerov/following{/other_user}","gists_url":"https://api.github.com/users/Raskerov/gists{/gist_id}","starred_url":"https://api.github.com/users/Raskerov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raskerov/subscriptions","organizations_url":"https://api.github.com/users/Raskerov/orgs","repos_url":"https://api.github.com/users/Raskerov/repos","events_url":"https://api.github.com/users/Raskerov/events{/privacy}","received_events_url":"https://api.github.com/users/Raskerov/received_events","type":"User","site_admin":false},"repo":{"id":63668963,"name":"RspecChallenges","full_name":"Raskerov/RspecChallenges","owner":{"login":"Raskerov","id":17760319,"avatar_url":"https://avatars.githubusercontent.com/u/17760319?v=3","gravatar_id":"","url":"https://api.github.com/users/Raskerov","html_url":"https://github.com/Raskerov","followers_url":"https://api.github.com/users/Raskerov/followers","following_url":"https://api.github.com/users/Raskerov/following{/other_user}","gists_url":"https://api.github.com/users/Raskerov/gists{/gist_id}","starred_url":"https://api.github.com/users/Raskerov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raskerov/subscriptions","organizations_url":"https://api.github.com/users/Raskerov/orgs","repos_url":"https://api.github.com/users/Raskerov/repos","events_url":"https://api.github.com/users/Raskerov/events{/privacy}","received_events_url":"https://api.github.com/users/Raskerov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Raskerov/RspecChallenges","description":null,"fork":false,"url":"https://api.github.com/repos/Raskerov/RspecChallenges","forks_url":"https://api.github.com/repos/Raskerov/RspecChallenges/forks","keys_url":"https://api.github.com/repos/Raskerov/RspecChallenges/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Raskerov/RspecChallenges/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Raskerov/RspecChallenges/teams","hooks_url":"https://api.github.com/repos/Raskerov/RspecChallenges/hooks","issue_events_url":"https://api.github.com/repos/Raskerov/RspecChallenges/issues/events{/number}","events_url":"https://api.github.com/repos/Raskerov/RspecChallenges/events","assignees_url":"https://api.github.com/repos/Raskerov/RspecChallenges/assignees{/user}","branches_url":"https://api.github.com/repos/Raskerov/RspecChallenges/branches{/branch}","tags_url":"https://api.github.com/repos/Raskerov/RspecChallenges/tags","blobs_url":"https://api.github.com/repos/Raskerov/RspecChallenges/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Raskerov/RspecChallenges/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Raskerov/RspecChallenges/git/refs{/sha}","trees_url":"https://api.github.com/repos/Raskerov/RspecChallenges/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Raskerov/RspecChallenges/statuses/{sha}","languages_url":"https://api.github.com/repos/Raskerov/RspecChallenges/languages","stargazers_url":"https://api.github.com/repos/Raskerov/RspecChallenges/stargazers","contributors_url":"https://api.github.com/repos/Raskerov/RspecChallenges/contributors","subscribers_url":"https://api.github.com/repos/Raskerov/RspecChallenges/subscribers","subscription_url":"https://api.github.com/repos/Raskerov/RspecChallenges/subscription","commits_url":"https://api.github.com/repos/Raskerov/RspecChallenges/commits{/sha}","git_commits_url":"https://api.github.com/repos/Raskerov/RspecChallenges/git/commits{/sha}","comments_url":"https://api.github.com/repos/Raskerov/RspecChallenges/comments{/number}","issue_comment_url":"https://api.github.com/repos/Raskerov/RspecChallenges/issues/comments{/number}","contents_url":"https://api.github.com/repos/Raskerov/RspecChallenges/contents/{+path}","compare_url":"https://api.github.com/repos/Raskerov/RspecChallenges/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Raskerov/RspecChallenges/merges","archive_url":"https://api.github.com/repos/Raskerov/RspecChallenges/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Raskerov/RspecChallenges/downloads","issues_url":"https://api.github.com/repos/Raskerov/RspecChallenges/issues{/number}","pulls_url":"https://api.github.com/repos/Raskerov/RspecChallenges/pulls{/number}","milestones_url":"https://api.github.com/repos/Raskerov/RspecChallenges/milestones{/number}","notifications_url":"https://api.github.com/repos/Raskerov/RspecChallenges/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Raskerov/RspecChallenges/labels{/name}","releases_url":"https://api.github.com/repos/Raskerov/RspecChallenges/releases{/id}","deployments_url":"https://api.github.com/repos/Raskerov/RspecChallenges/deployments","created_at":"2016-07-19T06:53:44Z","updated_at":"2016-07-19T06:53:44Z","pushed_at":"2016-07-19T10:02:07Z","git_url":"git://github.com/Raskerov/RspecChallenges.git","ssh_url":"git@github.com:Raskerov/RspecChallenges.git","clone_url":"https://github.com/Raskerov/RspecChallenges.git","svn_url":"https://github.com/Raskerov/RspecChallenges","homepage":null,"size":5,"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":"Raskerov:master","ref":"master","sha":"38fa9cd697b78cfdbd66aff6e2672f754683d731","user":{"login":"Raskerov","id":17760319,"avatar_url":"https://avatars.githubusercontent.com/u/17760319?v=3","gravatar_id":"","url":"https://api.github.com/users/Raskerov","html_url":"https://github.com/Raskerov","followers_url":"https://api.github.com/users/Raskerov/followers","following_url":"https://api.github.com/users/Raskerov/following{/other_user}","gists_url":"https://api.github.com/users/Raskerov/gists{/gist_id}","starred_url":"https://api.github.com/users/Raskerov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raskerov/subscriptions","organizations_url":"https://api.github.com/users/Raskerov/orgs","repos_url":"https://api.github.com/users/Raskerov/repos","events_url":"https://api.github.com/users/Raskerov/events{/privacy}","received_events_url":"https://api.github.com/users/Raskerov/received_events","type":"User","site_admin":false},"repo":{"id":63668963,"name":"RspecChallenges","full_name":"Raskerov/RspecChallenges","owner":{"login":"Raskerov","id":17760319,"avatar_url":"https://avatars.githubusercontent.com/u/17760319?v=3","gravatar_id":"","url":"https://api.github.com/users/Raskerov","html_url":"https://github.com/Raskerov","followers_url":"https://api.github.com/users/Raskerov/followers","following_url":"https://api.github.com/users/Raskerov/following{/other_user}","gists_url":"https://api.github.com/users/Raskerov/gists{/gist_id}","starred_url":"https://api.github.com/users/Raskerov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raskerov/subscriptions","organizations_url":"https://api.github.com/users/Raskerov/orgs","repos_url":"https://api.github.com/users/Raskerov/repos","events_url":"https://api.github.com/users/Raskerov/events{/privacy}","received_events_url":"https://api.github.com/users/Raskerov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Raskerov/RspecChallenges","description":null,"fork":false,"url":"https://api.github.com/repos/Raskerov/RspecChallenges","forks_url":"https://api.github.com/repos/Raskerov/RspecChallenges/forks","keys_url":"https://api.github.com/repos/Raskerov/RspecChallenges/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Raskerov/RspecChallenges/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Raskerov/RspecChallenges/teams","hooks_url":"https://api.github.com/repos/Raskerov/RspecChallenges/hooks","issue_events_url":"https://api.github.com/repos/Raskerov/RspecChallenges/issues/events{/number}","events_url":"https://api.github.com/repos/Raskerov/RspecChallenges/events","assignees_url":"https://api.github.com/repos/Raskerov/RspecChallenges/assignees{/user}","branches_url":"https://api.github.com/repos/Raskerov/RspecChallenges/branches{/branch}","tags_url":"https://api.github.com/repos/Raskerov/RspecChallenges/tags","blobs_url":"https://api.github.com/repos/Raskerov/RspecChallenges/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Raskerov/RspecChallenges/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Raskerov/RspecChallenges/git/refs{/sha}","trees_url":"https://api.github.com/repos/Raskerov/RspecChallenges/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Raskerov/RspecChallenges/statuses/{sha}","languages_url":"https://api.github.com/repos/Raskerov/RspecChallenges/languages","stargazers_url":"https://api.github.com/repos/Raskerov/RspecChallenges/stargazers","contributors_url":"https://api.github.com/repos/Raskerov/RspecChallenges/contributors","subscribers_url":"https://api.github.com/repos/Raskerov/RspecChallenges/subscribers","subscription_url":"https://api.github.com/repos/Raskerov/RspecChallenges/subscription","commits_url":"https://api.github.com/repos/Raskerov/RspecChallenges/commits{/sha}","git_commits_url":"https://api.github.com/repos/Raskerov/RspecChallenges/git/commits{/sha}","comments_url":"https://api.github.com/repos/Raskerov/RspecChallenges/comments{/number}","issue_comment_url":"https://api.github.com/repos/Raskerov/RspecChallenges/issues/comments{/number}","contents_url":"https://api.github.com/repos/Raskerov/RspecChallenges/contents/{+path}","compare_url":"https://api.github.com/repos/Raskerov/RspecChallenges/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Raskerov/RspecChallenges/merges","archive_url":"https://api.github.com/repos/Raskerov/RspecChallenges/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Raskerov/RspecChallenges/downloads","issues_url":"https://api.github.com/repos/Raskerov/RspecChallenges/issues{/number}","pulls_url":"https://api.github.com/repos/Raskerov/RspecChallenges/pulls{/number}","milestones_url":"https://api.github.com/repos/Raskerov/RspecChallenges/milestones{/number}","notifications_url":"https://api.github.com/repos/Raskerov/RspecChallenges/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Raskerov/RspecChallenges/labels{/name}","releases_url":"https://api.github.com/repos/Raskerov/RspecChallenges/releases{/id}","deployments_url":"https://api.github.com/repos/Raskerov/RspecChallenges/deployments","created_at":"2016-07-19T06:53:44Z","updated_at":"2016-07-19T06:53:44Z","pushed_at":"2016-07-19T10:02:07Z","git_url":"git://github.com/Raskerov/RspecChallenges.git","ssh_url":"git@github.com:Raskerov/RspecChallenges.git","clone_url":"https://github.com/Raskerov/RspecChallenges.git","svn_url":"https://github.com/Raskerov/RspecChallenges","homepage":null,"size":5,"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/Raskerov/RspecChallenges/pulls/1"},"html":{"href":"https://github.com/Raskerov/RspecChallenges/pull/1"},"issue":{"href":"https://api.github.com/repos/Raskerov/RspecChallenges/issues/1"},"comments":{"href":"https://api.github.com/repos/Raskerov/RspecChallenges/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Raskerov/RspecChallenges/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Raskerov/RspecChallenges/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Raskerov/RspecChallenges/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Raskerov/RspecChallenges/statuses/fbd4c1066a0a8b124f5dbe8819d3cdf88571803e"}}}}
{"actor":{"display_login":"cs3b"}}