{"action":"created","comment":{"url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/pulls/comments/122756281","pull_request_review_id":44896803,"id":122756281,"diff_hunk":"@@ -0,0 +1,107 @@\n+require_relative 'game'\n+\n+module Codebreaker\n+  class GameShell\n+    def initialize\n+      @game = Game.new\n+    end\n+\n+    def start\n+      loop do\n+        @game.start\n+\n+        puts 'Hello, this is Codebreaker.'\n+        puts 'You have to break code made of four digits from 1 to 6.'\n+        puts 'You have 1 hint and 7 turns to do this.'\n+        puts '+ will mark matching digit in right position.'\n+        puts '- will mark matching digit in wrong position.'\n+\n+        puts 'Enter \"hint\" to discover one random digit'\n+        puts 'Enter \"exit\" to give up'\n+        puts 'Make your guesses...'\n+\n+        break if game_loop\n+      end\n+    end\n+\n+    private\n+      def game_loop\n+        loop do\n+          input = ask_input\n+\n+          case input\n+            when /\\A[1-6]{4}\\z/\n+              case process_code(input)\n+                when 0; return false\n+                when 1; return true\n+              end\n+\n+            when /\\Ahint\\z/i\n+              puts @game.hint || 'No hints left'\n+\n+            when /\\Aexit\\z/i\n+              return true\n+\n+            else\n+              puts 'Wrong input.'\n+          end\n+\n+          puts('Turns left: ' + @game.turns.to_s + ', hints left: ' + @game.hints.to_s) if @game.turns > 0","path":"lib/codebreaker/game_shell.rb","position":49,"original_position":49,"commit_id":"970e669da84c63856ac28bbc2ac1f3c4ba2cdd1c","original_commit_id":"970e669da84c63856ac28bbc2ac1f3c4ba2cdd1c","user":{"login":"yamnich","id":1251643,"avatar_url":"https://avatars0.githubusercontent.com/u/1251643?v=3","gravatar_id":"","url":"https://api.github.com/users/yamnich","html_url":"https://github.com/yamnich","followers_url":"https://api.github.com/users/yamnich/followers","following_url":"https://api.github.com/users/yamnich/following{/other_user}","gists_url":"https://api.github.com/users/yamnich/gists{/gist_id}","starred_url":"https://api.github.com/users/yamnich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yamnich/subscriptions","organizations_url":"https://api.github.com/users/yamnich/orgs","repos_url":"https://api.github.com/users/yamnich/repos","events_url":"https://api.github.com/users/yamnich/events{/privacy}","received_events_url":"https://api.github.com/users/yamnich/received_events","type":"User","site_admin":false},"body":"please move message to variable/method","created_at":"2017-06-19T16:26:49Z","updated_at":"2017-06-19T16:34:45Z","html_url":"https://github.com/polykoi/RG_Courses_Codebreaker/pull/1#discussion_r122756281","pull_request_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/pulls/comments/122756281"},"html":{"href":"https://github.com/polykoi/RG_Courses_Codebreaker/pull/1#discussion_r122756281"},"pull_request":{"href":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/pulls/1","id":125155994,"html_url":"https://github.com/polykoi/RG_Courses_Codebreaker/pull/1","diff_url":"https://github.com/polykoi/RG_Courses_Codebreaker/pull/1.diff","patch_url":"https://github.com/polykoi/RG_Courses_Codebreaker/pull/1.patch","issue_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/issues/1","number":1,"state":"open","locked":false,"title":"Development","user":{"login":"polykoi","id":25607766,"avatar_url":"https://avatars3.githubusercontent.com/u/25607766?v=3","gravatar_id":"","url":"https://api.github.com/users/polykoi","html_url":"https://github.com/polykoi","followers_url":"https://api.github.com/users/polykoi/followers","following_url":"https://api.github.com/users/polykoi/following{/other_user}","gists_url":"https://api.github.com/users/polykoi/gists{/gist_id}","starred_url":"https://api.github.com/users/polykoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polykoi/subscriptions","organizations_url":"https://api.github.com/users/polykoi/orgs","repos_url":"https://api.github.com/users/polykoi/repos","events_url":"https://api.github.com/users/polykoi/events{/privacy}","received_events_url":"https://api.github.com/users/polykoi/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-06-12T14:54:30Z","updated_at":"2017-06-19T16:34:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"32763ac474323e37be74d25b49197b27170c9307","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/pulls/1/commits","review_comments_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/pulls/1/comments","review_comment_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/issues/1/comments","statuses_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/statuses/970e669da84c63856ac28bbc2ac1f3c4ba2cdd1c","head":{"label":"polykoi:development","ref":"development","sha":"970e669da84c63856ac28bbc2ac1f3c4ba2cdd1c","user":{"login":"polykoi","id":25607766,"avatar_url":"https://avatars3.githubusercontent.com/u/25607766?v=3","gravatar_id":"","url":"https://api.github.com/users/polykoi","html_url":"https://github.com/polykoi","followers_url":"https://api.github.com/users/polykoi/followers","following_url":"https://api.github.com/users/polykoi/following{/other_user}","gists_url":"https://api.github.com/users/polykoi/gists{/gist_id}","starred_url":"https://api.github.com/users/polykoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polykoi/subscriptions","organizations_url":"https://api.github.com/users/polykoi/orgs","repos_url":"https://api.github.com/users/polykoi/repos","events_url":"https://api.github.com/users/polykoi/events{/privacy}","received_events_url":"https://api.github.com/users/polykoi/received_events","type":"User","site_admin":false},"repo":{"id":91836677,"name":"RG_Courses_Codebreaker","full_name":"polykoi/RG_Courses_Codebreaker","owner":{"login":"polykoi","id":25607766,"avatar_url":"https://avatars3.githubusercontent.com/u/25607766?v=3","gravatar_id":"","url":"https://api.github.com/users/polykoi","html_url":"https://github.com/polykoi","followers_url":"https://api.github.com/users/polykoi/followers","following_url":"https://api.github.com/users/polykoi/following{/other_user}","gists_url":"https://api.github.com/users/polykoi/gists{/gist_id}","starred_url":"https://api.github.com/users/polykoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polykoi/subscriptions","organizations_url":"https://api.github.com/users/polykoi/orgs","repos_url":"https://api.github.com/users/polykoi/repos","events_url":"https://api.github.com/users/polykoi/events{/privacy}","received_events_url":"https://api.github.com/users/polykoi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/polykoi/RG_Courses_Codebreaker","description":null,"fork":false,"url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker","forks_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/forks","keys_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/teams","hooks_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/hooks","issue_events_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/issues/events{/number}","events_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/events","assignees_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/assignees{/user}","branches_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/branches{/branch}","tags_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/tags","blobs_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/git/refs{/sha}","trees_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/statuses/{sha}","languages_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/languages","stargazers_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/stargazers","contributors_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/contributors","subscribers_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/subscribers","subscription_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/subscription","commits_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/commits{/sha}","git_commits_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/git/commits{/sha}","comments_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/comments{/number}","issue_comment_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/issues/comments{/number}","contents_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/contents/{+path}","compare_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/merges","archive_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/downloads","issues_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/issues{/number}","pulls_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/pulls{/number}","milestones_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/milestones{/number}","notifications_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/labels{/name}","releases_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/releases{/id}","deployments_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/deployments","created_at":"2017-05-19T18:58:21Z","updated_at":"2017-05-19T18:58:21Z","pushed_at":"2017-06-19T14:45:14Z","git_url":"git://github.com/polykoi/RG_Courses_Codebreaker.git","ssh_url":"git@github.com:polykoi/RG_Courses_Codebreaker.git","clone_url":"https://github.com/polykoi/RG_Courses_Codebreaker.git","svn_url":"https://github.com/polykoi/RG_Courses_Codebreaker","homepage":null,"size":11,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":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":"polykoi:master","ref":"master","sha":"d196476bbfa228ff9db6e03f5fbccea2833ae138","user":{"login":"polykoi","id":25607766,"avatar_url":"https://avatars3.githubusercontent.com/u/25607766?v=3","gravatar_id":"","url":"https://api.github.com/users/polykoi","html_url":"https://github.com/polykoi","followers_url":"https://api.github.com/users/polykoi/followers","following_url":"https://api.github.com/users/polykoi/following{/other_user}","gists_url":"https://api.github.com/users/polykoi/gists{/gist_id}","starred_url":"https://api.github.com/users/polykoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polykoi/subscriptions","organizations_url":"https://api.github.com/users/polykoi/orgs","repos_url":"https://api.github.com/users/polykoi/repos","events_url":"https://api.github.com/users/polykoi/events{/privacy}","received_events_url":"https://api.github.com/users/polykoi/received_events","type":"User","site_admin":false},"repo":{"id":91836677,"name":"RG_Courses_Codebreaker","full_name":"polykoi/RG_Courses_Codebreaker","owner":{"login":"polykoi","id":25607766,"avatar_url":"https://avatars3.githubusercontent.com/u/25607766?v=3","gravatar_id":"","url":"https://api.github.com/users/polykoi","html_url":"https://github.com/polykoi","followers_url":"https://api.github.com/users/polykoi/followers","following_url":"https://api.github.com/users/polykoi/following{/other_user}","gists_url":"https://api.github.com/users/polykoi/gists{/gist_id}","starred_url":"https://api.github.com/users/polykoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polykoi/subscriptions","organizations_url":"https://api.github.com/users/polykoi/orgs","repos_url":"https://api.github.com/users/polykoi/repos","events_url":"https://api.github.com/users/polykoi/events{/privacy}","received_events_url":"https://api.github.com/users/polykoi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/polykoi/RG_Courses_Codebreaker","description":null,"fork":false,"url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker","forks_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/forks","keys_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/teams","hooks_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/hooks","issue_events_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/issues/events{/number}","events_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/events","assignees_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/assignees{/user}","branches_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/branches{/branch}","tags_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/tags","blobs_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/git/refs{/sha}","trees_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/statuses/{sha}","languages_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/languages","stargazers_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/stargazers","contributors_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/contributors","subscribers_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/subscribers","subscription_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/subscription","commits_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/commits{/sha}","git_commits_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/git/commits{/sha}","comments_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/comments{/number}","issue_comment_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/issues/comments{/number}","contents_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/contents/{+path}","compare_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/merges","archive_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/downloads","issues_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/issues{/number}","pulls_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/pulls{/number}","milestones_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/milestones{/number}","notifications_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/labels{/name}","releases_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/releases{/id}","deployments_url":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/deployments","created_at":"2017-05-19T18:58:21Z","updated_at":"2017-05-19T18:58:21Z","pushed_at":"2017-06-19T14:45:14Z","git_url":"git://github.com/polykoi/RG_Courses_Codebreaker.git","ssh_url":"git@github.com:polykoi/RG_Courses_Codebreaker.git","clone_url":"https://github.com/polykoi/RG_Courses_Codebreaker.git","svn_url":"https://github.com/polykoi/RG_Courses_Codebreaker","homepage":null,"size":11,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":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/polykoi/RG_Courses_Codebreaker/pulls/1"},"html":{"href":"https://github.com/polykoi/RG_Courses_Codebreaker/pull/1"},"issue":{"href":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/issues/1"},"comments":{"href":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/polykoi/RG_Courses_Codebreaker/statuses/970e669da84c63856ac28bbc2ac1f3c4ba2cdd1c"}}}}
{"actor":{"display_login":"yamnich"}}