{"action":"created","comment":{"url":"https://api.github.com/repos/MayaCherry1/mastermind/pulls/comments/205538166","pull_request_review_id":140828983,"id":205538166,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTUzODE2Ng==","diff_hunk":"@@ -8,17 +9,59 @@ class GameState\n \tGUESS_LIMIT = 10\n \tCODE_LENGTH = 4\n \n-\tattr_accessor :has_won, :past_guesses\n-\tattr_reader :secret_code \n \n-\tdef initialize\n+\tattr_accessor :has_won\n+\tattr_reader :secret_code, :past_guesses\n+\t\t\n+\tdef initialize(sc = CodeGenerator, g = Guess)\n \t\t@has_won = false\n-\t\t@past_guesses = PastGuesses.new\n-\t\t@secret_code = CodeGenerator.generate\n+\t\t@past_guesses = []\n+\t\t@secret_code = sc.generate\n+\t\t@g = Guess\n \tend\n \n \tdef remaining_guesses\n \t\tGUESS_LIMIT - past_guesses.size\n \tend\n \n+\tdef save_guess(guess)\n+\t\tpast_guesses << guess\n+\tend\n+\n+\tdef save_state\n+\t\tcurrent_state = { \n+\t\t\t:has_won => @has_won, \n+\t\t\t:secret_code => @secret_code,\n+\t\t\t:past_guesses => @past_guesses.map { |g| g.code }\n+\t\t}","path":"lib/game_state.rb","position":41,"original_position":41,"commit_id":"38c8e011cdb09bea62a1efaa072e944ab5acd764","original_commit_id":"38c8e011cdb09bea62a1efaa072e944ab5acd764","user":{"login":"ssunday","id":3252602,"node_id":"MDQ6VXNlcjMyNTI2MDI=","avatar_url":"https://avatars3.githubusercontent.com/u/3252602?v=4","gravatar_id":"","url":"https://api.github.com/users/ssunday","html_url":"https://github.com/ssunday","followers_url":"https://api.github.com/users/ssunday/followers","following_url":"https://api.github.com/users/ssunday/following{/other_user}","gists_url":"https://api.github.com/users/ssunday/gists{/gist_id}","starred_url":"https://api.github.com/users/ssunday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssunday/subscriptions","organizations_url":"https://api.github.com/users/ssunday/orgs","repos_url":"https://api.github.com/users/ssunday/repos","events_url":"https://api.github.com/users/ssunday/events{/privacy}","received_events_url":"https://api.github.com/users/ssunday/received_events","type":"User","site_admin":false},"body":"Because then the JSON dependency would be yanked out into a very thin file that only does a few things...","created_at":"2018-07-26T17:24:11Z","updated_at":"2018-07-26T17:24:11Z","html_url":"https://github.com/MayaCherry1/mastermind/pull/4#discussion_r205538166","pull_request_url":"https://api.github.com/repos/MayaCherry1/mastermind/pulls/4","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/MayaCherry1/mastermind/pulls/comments/205538166"},"html":{"href":"https://github.com/MayaCherry1/mastermind/pull/4#discussion_r205538166"},"pull_request":{"href":"https://api.github.com/repos/MayaCherry1/mastermind/pulls/4"}},"in_reply_to_id":205537855},"pull_request":{"url":"https://api.github.com/repos/MayaCherry1/mastermind/pulls/4","id":203964200,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzOTY0MjAw","html_url":"https://github.com/MayaCherry1/mastermind/pull/4","diff_url":"https://github.com/MayaCherry1/mastermind/pull/4.diff","patch_url":"https://github.com/MayaCherry1/mastermind/pull/4.patch","issue_url":"https://api.github.com/repos/MayaCherry1/mastermind/issues/4","number":4,"state":"open","locked":false,"title":"Save state","user":{"login":"MayaCherry1","id":32504768,"node_id":"MDQ6VXNlcjMyNTA0NzY4","avatar_url":"https://avatars1.githubusercontent.com/u/32504768?v=4","gravatar_id":"","url":"https://api.github.com/users/MayaCherry1","html_url":"https://github.com/MayaCherry1","followers_url":"https://api.github.com/users/MayaCherry1/followers","following_url":"https://api.github.com/users/MayaCherry1/following{/other_user}","gists_url":"https://api.github.com/users/MayaCherry1/gists{/gist_id}","starred_url":"https://api.github.com/users/MayaCherry1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MayaCherry1/subscriptions","organizations_url":"https://api.github.com/users/MayaCherry1/orgs","repos_url":"https://api.github.com/users/MayaCherry1/repos","events_url":"https://api.github.com/users/MayaCherry1/events{/privacy}","received_events_url":"https://api.github.com/users/MayaCherry1/received_events","type":"User","site_admin":false},"body":"Game saves to a json file after each guess. Upon launch of a new game, player is given option to resume game. If chosen, the program parses the json file to resume last game.","created_at":"2018-07-25T21:09:25Z","updated_at":"2018-07-26T17:24:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"16192b565b98fab5522defb9dfb5077b997a343f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/MayaCherry1/mastermind/pulls/4/commits","review_comments_url":"https://api.github.com/repos/MayaCherry1/mastermind/pulls/4/comments","review_comment_url":"https://api.github.com/repos/MayaCherry1/mastermind/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MayaCherry1/mastermind/issues/4/comments","statuses_url":"https://api.github.com/repos/MayaCherry1/mastermind/statuses/38c8e011cdb09bea62a1efaa072e944ab5acd764","head":{"label":"MayaCherry1:save_state","ref":"save_state","sha":"38c8e011cdb09bea62a1efaa072e944ab5acd764","user":{"login":"MayaCherry1","id":32504768,"node_id":"MDQ6VXNlcjMyNTA0NzY4","avatar_url":"https://avatars1.githubusercontent.com/u/32504768?v=4","gravatar_id":"","url":"https://api.github.com/users/MayaCherry1","html_url":"https://github.com/MayaCherry1","followers_url":"https://api.github.com/users/MayaCherry1/followers","following_url":"https://api.github.com/users/MayaCherry1/following{/other_user}","gists_url":"https://api.github.com/users/MayaCherry1/gists{/gist_id}","starred_url":"https://api.github.com/users/MayaCherry1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MayaCherry1/subscriptions","organizations_url":"https://api.github.com/users/MayaCherry1/orgs","repos_url":"https://api.github.com/users/MayaCherry1/repos","events_url":"https://api.github.com/users/MayaCherry1/events{/privacy}","received_events_url":"https://api.github.com/users/MayaCherry1/received_events","type":"User","site_admin":false},"repo":{"id":137114740,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcxMTQ3NDA=","name":"mastermind","full_name":"MayaCherry1/mastermind","owner":{"login":"MayaCherry1","id":32504768,"node_id":"MDQ6VXNlcjMyNTA0NzY4","avatar_url":"https://avatars1.githubusercontent.com/u/32504768?v=4","gravatar_id":"","url":"https://api.github.com/users/MayaCherry1","html_url":"https://github.com/MayaCherry1","followers_url":"https://api.github.com/users/MayaCherry1/followers","following_url":"https://api.github.com/users/MayaCherry1/following{/other_user}","gists_url":"https://api.github.com/users/MayaCherry1/gists{/gist_id}","starred_url":"https://api.github.com/users/MayaCherry1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MayaCherry1/subscriptions","organizations_url":"https://api.github.com/users/MayaCherry1/orgs","repos_url":"https://api.github.com/users/MayaCherry1/repos","events_url":"https://api.github.com/users/MayaCherry1/events{/privacy}","received_events_url":"https://api.github.com/users/MayaCherry1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MayaCherry1/mastermind","description":null,"fork":false,"url":"https://api.github.com/repos/MayaCherry1/mastermind","forks_url":"https://api.github.com/repos/MayaCherry1/mastermind/forks","keys_url":"https://api.github.com/repos/MayaCherry1/mastermind/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MayaCherry1/mastermind/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MayaCherry1/mastermind/teams","hooks_url":"https://api.github.com/repos/MayaCherry1/mastermind/hooks","issue_events_url":"https://api.github.com/repos/MayaCherry1/mastermind/issues/events{/number}","events_url":"https://api.github.com/repos/MayaCherry1/mastermind/events","assignees_url":"https://api.github.com/repos/MayaCherry1/mastermind/assignees{/user}","branches_url":"https://api.github.com/repos/MayaCherry1/mastermind/branches{/branch}","tags_url":"https://api.github.com/repos/MayaCherry1/mastermind/tags","blobs_url":"https://api.github.com/repos/MayaCherry1/mastermind/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MayaCherry1/mastermind/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MayaCherry1/mastermind/git/refs{/sha}","trees_url":"https://api.github.com/repos/MayaCherry1/mastermind/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MayaCherry1/mastermind/statuses/{sha}","languages_url":"https://api.github.com/repos/MayaCherry1/mastermind/languages","stargazers_url":"https://api.github.com/repos/MayaCherry1/mastermind/stargazers","contributors_url":"https://api.github.com/repos/MayaCherry1/mastermind/contributors","subscribers_url":"https://api.github.com/repos/MayaCherry1/mastermind/subscribers","subscription_url":"https://api.github.com/repos/MayaCherry1/mastermind/subscription","commits_url":"https://api.github.com/repos/MayaCherry1/mastermind/commits{/sha}","git_commits_url":"https://api.github.com/repos/MayaCherry1/mastermind/git/commits{/sha}","comments_url":"https://api.github.com/repos/MayaCherry1/mastermind/comments{/number}","issue_comment_url":"https://api.github.com/repos/MayaCherry1/mastermind/issues/comments{/number}","contents_url":"https://api.github.com/repos/MayaCherry1/mastermind/contents/{+path}","compare_url":"https://api.github.com/repos/MayaCherry1/mastermind/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MayaCherry1/mastermind/merges","archive_url":"https://api.github.com/repos/MayaCherry1/mastermind/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MayaCherry1/mastermind/downloads","issues_url":"https://api.github.com/repos/MayaCherry1/mastermind/issues{/number}","pulls_url":"https://api.github.com/repos/MayaCherry1/mastermind/pulls{/number}","milestones_url":"https://api.github.com/repos/MayaCherry1/mastermind/milestones{/number}","notifications_url":"https://api.github.com/repos/MayaCherry1/mastermind/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MayaCherry1/mastermind/labels{/name}","releases_url":"https://api.github.com/repos/MayaCherry1/mastermind/releases{/id}","deployments_url":"https://api.github.com/repos/MayaCherry1/mastermind/deployments","created_at":"2018-06-12T18:53:24Z","updated_at":"2018-07-12T14:06:19Z","pushed_at":"2018-07-26T17:12:22Z","git_url":"git://github.com/MayaCherry1/mastermind.git","ssh_url":"git@github.com:MayaCherry1/mastermind.git","clone_url":"https://github.com/MayaCherry1/mastermind.git","svn_url":"https://github.com/MayaCherry1/mastermind","homepage":null,"size":50,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"MayaCherry1:master","ref":"master","sha":"a1b33eeba9b0546c796842413c1fda1c5914cd1c","user":{"login":"MayaCherry1","id":32504768,"node_id":"MDQ6VXNlcjMyNTA0NzY4","avatar_url":"https://avatars1.githubusercontent.com/u/32504768?v=4","gravatar_id":"","url":"https://api.github.com/users/MayaCherry1","html_url":"https://github.com/MayaCherry1","followers_url":"https://api.github.com/users/MayaCherry1/followers","following_url":"https://api.github.com/users/MayaCherry1/following{/other_user}","gists_url":"https://api.github.com/users/MayaCherry1/gists{/gist_id}","starred_url":"https://api.github.com/users/MayaCherry1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MayaCherry1/subscriptions","organizations_url":"https://api.github.com/users/MayaCherry1/orgs","repos_url":"https://api.github.com/users/MayaCherry1/repos","events_url":"https://api.github.com/users/MayaCherry1/events{/privacy}","received_events_url":"https://api.github.com/users/MayaCherry1/received_events","type":"User","site_admin":false},"repo":{"id":137114740,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcxMTQ3NDA=","name":"mastermind","full_name":"MayaCherry1/mastermind","owner":{"login":"MayaCherry1","id":32504768,"node_id":"MDQ6VXNlcjMyNTA0NzY4","avatar_url":"https://avatars1.githubusercontent.com/u/32504768?v=4","gravatar_id":"","url":"https://api.github.com/users/MayaCherry1","html_url":"https://github.com/MayaCherry1","followers_url":"https://api.github.com/users/MayaCherry1/followers","following_url":"https://api.github.com/users/MayaCherry1/following{/other_user}","gists_url":"https://api.github.com/users/MayaCherry1/gists{/gist_id}","starred_url":"https://api.github.com/users/MayaCherry1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MayaCherry1/subscriptions","organizations_url":"https://api.github.com/users/MayaCherry1/orgs","repos_url":"https://api.github.com/users/MayaCherry1/repos","events_url":"https://api.github.com/users/MayaCherry1/events{/privacy}","received_events_url":"https://api.github.com/users/MayaCherry1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MayaCherry1/mastermind","description":null,"fork":false,"url":"https://api.github.com/repos/MayaCherry1/mastermind","forks_url":"https://api.github.com/repos/MayaCherry1/mastermind/forks","keys_url":"https://api.github.com/repos/MayaCherry1/mastermind/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MayaCherry1/mastermind/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MayaCherry1/mastermind/teams","hooks_url":"https://api.github.com/repos/MayaCherry1/mastermind/hooks","issue_events_url":"https://api.github.com/repos/MayaCherry1/mastermind/issues/events{/number}","events_url":"https://api.github.com/repos/MayaCherry1/mastermind/events","assignees_url":"https://api.github.com/repos/MayaCherry1/mastermind/assignees{/user}","branches_url":"https://api.github.com/repos/MayaCherry1/mastermind/branches{/branch}","tags_url":"https://api.github.com/repos/MayaCherry1/mastermind/tags","blobs_url":"https://api.github.com/repos/MayaCherry1/mastermind/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MayaCherry1/mastermind/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MayaCherry1/mastermind/git/refs{/sha}","trees_url":"https://api.github.com/repos/MayaCherry1/mastermind/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MayaCherry1/mastermind/statuses/{sha}","languages_url":"https://api.github.com/repos/MayaCherry1/mastermind/languages","stargazers_url":"https://api.github.com/repos/MayaCherry1/mastermind/stargazers","contributors_url":"https://api.github.com/repos/MayaCherry1/mastermind/contributors","subscribers_url":"https://api.github.com/repos/MayaCherry1/mastermind/subscribers","subscription_url":"https://api.github.com/repos/MayaCherry1/mastermind/subscription","commits_url":"https://api.github.com/repos/MayaCherry1/mastermind/commits{/sha}","git_commits_url":"https://api.github.com/repos/MayaCherry1/mastermind/git/commits{/sha}","comments_url":"https://api.github.com/repos/MayaCherry1/mastermind/comments{/number}","issue_comment_url":"https://api.github.com/repos/MayaCherry1/mastermind/issues/comments{/number}","contents_url":"https://api.github.com/repos/MayaCherry1/mastermind/contents/{+path}","compare_url":"https://api.github.com/repos/MayaCherry1/mastermind/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MayaCherry1/mastermind/merges","archive_url":"https://api.github.com/repos/MayaCherry1/mastermind/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MayaCherry1/mastermind/downloads","issues_url":"https://api.github.com/repos/MayaCherry1/mastermind/issues{/number}","pulls_url":"https://api.github.com/repos/MayaCherry1/mastermind/pulls{/number}","milestones_url":"https://api.github.com/repos/MayaCherry1/mastermind/milestones{/number}","notifications_url":"https://api.github.com/repos/MayaCherry1/mastermind/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MayaCherry1/mastermind/labels{/name}","releases_url":"https://api.github.com/repos/MayaCherry1/mastermind/releases{/id}","deployments_url":"https://api.github.com/repos/MayaCherry1/mastermind/deployments","created_at":"2018-06-12T18:53:24Z","updated_at":"2018-07-12T14:06:19Z","pushed_at":"2018-07-26T17:12:22Z","git_url":"git://github.com/MayaCherry1/mastermind.git","ssh_url":"git@github.com:MayaCherry1/mastermind.git","clone_url":"https://github.com/MayaCherry1/mastermind.git","svn_url":"https://github.com/MayaCherry1/mastermind","homepage":null,"size":50,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MayaCherry1/mastermind/pulls/4"},"html":{"href":"https://github.com/MayaCherry1/mastermind/pull/4"},"issue":{"href":"https://api.github.com/repos/MayaCherry1/mastermind/issues/4"},"comments":{"href":"https://api.github.com/repos/MayaCherry1/mastermind/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/MayaCherry1/mastermind/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/MayaCherry1/mastermind/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MayaCherry1/mastermind/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/MayaCherry1/mastermind/statuses/38c8e011cdb09bea62a1efaa072e944ab5acd764"}},"author_association":"OWNER"}}
{"actor":{"display_login":"ssunday"}}