{"action":"created","comment":{"url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/pulls/comments/223915886","pull_request_review_id":163160681,"id":223915886,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzkxNTg4Ng==","diff_hunk":"@@ -0,0 +1,121 @@\n+# # Print 1-255\n+# puts (1...256).each {|i| puts i}\n+\n+# # Print odd numbers between 1-255\n+# puts (1...256).each {|i| puts i if i % 2 !=0 }\n+\n+# # Print Sum\n+# # Write a program that would print the numbers from 0 to 255 but this time, it would also print the sum of the numbers that have been printed so far.\n+\n+# sum = 0\n+# (0...255).each do |num|\n+# \tsum += num\n+# \tputs \"New number: #{num} sum: #{sum}\"\n+# end\n+\n+\n+# # Iterating through an array\n+# # Given an array X, say [1,3,5,7,9,13], write a program that would iterate through each member of the array and print each value on the screen. Being able to loop through each member of the array is extremely important.\n+\n+# arr = [1,3,5,7,9,13]\n+# (0..arr.count-1).each {|i| puts arr[i]}\n+\n+\n+# # Find Max\n+# # Write a program (sets of instructions) that takes any array and prints the maximum value in the array. Your program should also work with a given array that has all negative numbers (e.g. [-3, -5, -7]), \n+# # or even a mix of positive numbers, negative numbers and zero.\n+\n+# arr = [-2, 3, 0, -5, -9, 10, 15]\n+# puts arr.max\n+\n+\n+# # Shifting the values in the array\n+# # Given any array x, say [1, 5, 10, 7, -2], create an algorithm that shifts each number by one to the front.  For example, when the program is done, an x of [1, 5, 10, 7, -2] should become [5, 10, 7, -2, 0].\n+\n+# arr = [1, 5, 10, 7, -2]\n+# (1..arr.count-1).each {|i| arr[i-1] = arr[i]}\n+# arr[arr.count - 1] = 0\n+# puts arr.to_s\n+\n+# # Get Average\n+# # Write a program that takes an array, and prints the AVERAGE of the values in the array. For example for an array [2, 10, 3], your program should print an average of 5. \n+# # Again, make sure you come up with a simple base case and write instructions to solve that base case first, then test your instructions for other complicated cases. You can use a count function with this assignment.\n+\n+# arr = [2,10,3,18]\n+# sum = 0.00\n+# average = 0.00\n+# arr.each do |num|\n+# \tsum += num\n+# end \n+# average = sum / arr.length","path":"evelyn_chavez/ruby_exercises/basic_13.rb","position":50,"original_position":50,"commit_id":"3b6353b763ee501f0387f6550fdbdb8c39d572c2","original_commit_id":"58b9b4aad8679b7c49694c90b58478c90885dc47","user":{"login":"ranriy","id":8671983,"node_id":"MDQ6VXNlcjg2NzE5ODM=","avatar_url":"https://avatars0.githubusercontent.com/u/8671983?v=4","gravatar_id":"","url":"https://api.github.com/users/ranriy","html_url":"https://github.com/ranriy","followers_url":"https://api.github.com/users/ranriy/followers","following_url":"https://api.github.com/users/ranriy/following{/other_user}","gists_url":"https://api.github.com/users/ranriy/gists{/gist_id}","starred_url":"https://api.github.com/users/ranriy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ranriy/subscriptions","organizations_url":"https://api.github.com/users/ranriy/orgs","repos_url":"https://api.github.com/users/ranriy/repos","events_url":"https://api.github.com/users/ranriy/events{/privacy}","received_events_url":"https://api.github.com/users/ranriy/received_events","type":"User","site_admin":false},"body":"check for the case when the array is empty to avoid division by 0","created_at":"2018-10-10T01:55:46Z","updated_at":"2018-10-10T01:55:47Z","html_url":"https://github.com/CodingDojoDallas/ruby_oct_2018/pull/2#discussion_r223915886","pull_request_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/pulls/2","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/pulls/comments/223915886"},"html":{"href":"https://github.com/CodingDojoDallas/ruby_oct_2018/pull/2#discussion_r223915886"},"pull_request":{"href":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/pulls/2","id":220488079,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwNDg4MDc5","html_url":"https://github.com/CodingDojoDallas/ruby_oct_2018/pull/2","diff_url":"https://github.com/CodingDojoDallas/ruby_oct_2018/pull/2.diff","patch_url":"https://github.com/CodingDojoDallas/ruby_oct_2018/pull/2.patch","issue_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/issues/2","number":2,"state":"open","locked":false,"title":"ruby commit","user":{"login":"echavez10","id":42080315,"node_id":"MDQ6VXNlcjQyMDgwMzE1","avatar_url":"https://avatars2.githubusercontent.com/u/42080315?v=4","gravatar_id":"","url":"https://api.github.com/users/echavez10","html_url":"https://github.com/echavez10","followers_url":"https://api.github.com/users/echavez10/followers","following_url":"https://api.github.com/users/echavez10/following{/other_user}","gists_url":"https://api.github.com/users/echavez10/gists{/gist_id}","starred_url":"https://api.github.com/users/echavez10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echavez10/subscriptions","organizations_url":"https://api.github.com/users/echavez10/orgs","repos_url":"https://api.github.com/users/echavez10/repos","events_url":"https://api.github.com/users/echavez10/events{/privacy}","received_events_url":"https://api.github.com/users/echavez10/received_events","type":"User","site_admin":false},"body":"assignments","created_at":"2018-10-04T19:17:41Z","updated_at":"2018-10-10T01:55:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8dac0a960c68efdd5a0de9655a594e1f92144747","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/pulls/2/commits","review_comments_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/pulls/2/comments","review_comment_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/issues/2/comments","statuses_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/statuses/3b6353b763ee501f0387f6550fdbdb8c39d572c2","head":{"label":"echavez10:master","ref":"master","sha":"3b6353b763ee501f0387f6550fdbdb8c39d572c2","user":{"login":"echavez10","id":42080315,"node_id":"MDQ6VXNlcjQyMDgwMzE1","avatar_url":"https://avatars2.githubusercontent.com/u/42080315?v=4","gravatar_id":"","url":"https://api.github.com/users/echavez10","html_url":"https://github.com/echavez10","followers_url":"https://api.github.com/users/echavez10/followers","following_url":"https://api.github.com/users/echavez10/following{/other_user}","gists_url":"https://api.github.com/users/echavez10/gists{/gist_id}","starred_url":"https://api.github.com/users/echavez10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echavez10/subscriptions","organizations_url":"https://api.github.com/users/echavez10/orgs","repos_url":"https://api.github.com/users/echavez10/repos","events_url":"https://api.github.com/users/echavez10/events{/privacy}","received_events_url":"https://api.github.com/users/echavez10/received_events","type":"User","site_admin":false},"repo":{"id":151622889,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE2MjI4ODk=","name":"ruby_oct_2018","full_name":"echavez10/ruby_oct_2018","private":false,"owner":{"login":"echavez10","id":42080315,"node_id":"MDQ6VXNlcjQyMDgwMzE1","avatar_url":"https://avatars2.githubusercontent.com/u/42080315?v=4","gravatar_id":"","url":"https://api.github.com/users/echavez10","html_url":"https://github.com/echavez10","followers_url":"https://api.github.com/users/echavez10/followers","following_url":"https://api.github.com/users/echavez10/following{/other_user}","gists_url":"https://api.github.com/users/echavez10/gists{/gist_id}","starred_url":"https://api.github.com/users/echavez10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echavez10/subscriptions","organizations_url":"https://api.github.com/users/echavez10/orgs","repos_url":"https://api.github.com/users/echavez10/repos","events_url":"https://api.github.com/users/echavez10/events{/privacy}","received_events_url":"https://api.github.com/users/echavez10/received_events","type":"User","site_admin":false},"html_url":"https://github.com/echavez10/ruby_oct_2018","description":null,"fork":true,"url":"https://api.github.com/repos/echavez10/ruby_oct_2018","forks_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/forks","keys_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/keys{/key_id}","collaborators_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/teams","hooks_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/hooks","issue_events_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/issues/events{/number}","events_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/events","assignees_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/assignees{/user}","branches_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/branches{/branch}","tags_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/tags","blobs_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/git/refs{/sha}","trees_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/git/trees{/sha}","statuses_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/statuses/{sha}","languages_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/languages","stargazers_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/stargazers","contributors_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/contributors","subscribers_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/subscribers","subscription_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/subscription","commits_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/commits{/sha}","git_commits_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/git/commits{/sha}","comments_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/comments{/number}","issue_comment_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/issues/comments{/number}","contents_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/contents/{+path}","compare_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/compare/{base}...{head}","merges_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/merges","archive_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/downloads","issues_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/issues{/number}","pulls_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/pulls{/number}","milestones_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/milestones{/number}","notifications_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/labels{/name}","releases_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/releases{/id}","deployments_url":"https://api.github.com/repos/echavez10/ruby_oct_2018/deployments","created_at":"2018-10-04T19:09:35Z","updated_at":"2018-10-05T04:33:34Z","pushed_at":"2018-10-05T04:33:33Z","git_url":"git://github.com/echavez10/ruby_oct_2018.git","ssh_url":"git@github.com:echavez10/ruby_oct_2018.git","clone_url":"https://github.com/echavez10/ruby_oct_2018.git","svn_url":"https://github.com/echavez10/ruby_oct_2018","homepage":null,"size":15,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"CodingDojoDallas:master","ref":"master","sha":"5effd66209de89e14fa27d4af6c23b55527a9277","user":{"login":"CodingDojoDallas","id":22032006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDMyMDA2","avatar_url":"https://avatars2.githubusercontent.com/u/22032006?v=4","gravatar_id":"","url":"https://api.github.com/users/CodingDojoDallas","html_url":"https://github.com/CodingDojoDallas","followers_url":"https://api.github.com/users/CodingDojoDallas/followers","following_url":"https://api.github.com/users/CodingDojoDallas/following{/other_user}","gists_url":"https://api.github.com/users/CodingDojoDallas/gists{/gist_id}","starred_url":"https://api.github.com/users/CodingDojoDallas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodingDojoDallas/subscriptions","organizations_url":"https://api.github.com/users/CodingDojoDallas/orgs","repos_url":"https://api.github.com/users/CodingDojoDallas/repos","events_url":"https://api.github.com/users/CodingDojoDallas/events{/privacy}","received_events_url":"https://api.github.com/users/CodingDojoDallas/received_events","type":"Organization","site_admin":false},"repo":{"id":151157863,"node_id":"MDEwOlJlcG9zaXRvcnkxNTExNTc4NjM=","name":"ruby_oct_2018","full_name":"CodingDojoDallas/ruby_oct_2018","private":false,"owner":{"login":"CodingDojoDallas","id":22032006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDMyMDA2","avatar_url":"https://avatars2.githubusercontent.com/u/22032006?v=4","gravatar_id":"","url":"https://api.github.com/users/CodingDojoDallas","html_url":"https://github.com/CodingDojoDallas","followers_url":"https://api.github.com/users/CodingDojoDallas/followers","following_url":"https://api.github.com/users/CodingDojoDallas/following{/other_user}","gists_url":"https://api.github.com/users/CodingDojoDallas/gists{/gist_id}","starred_url":"https://api.github.com/users/CodingDojoDallas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodingDojoDallas/subscriptions","organizations_url":"https://api.github.com/users/CodingDojoDallas/orgs","repos_url":"https://api.github.com/users/CodingDojoDallas/repos","events_url":"https://api.github.com/users/CodingDojoDallas/events{/privacy}","received_events_url":"https://api.github.com/users/CodingDojoDallas/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/CodingDojoDallas/ruby_oct_2018","description":null,"fork":false,"url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018","forks_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/forks","keys_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/teams","hooks_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/hooks","issue_events_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/issues/events{/number}","events_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/events","assignees_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/assignees{/user}","branches_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/branches{/branch}","tags_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/tags","blobs_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/git/refs{/sha}","trees_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/statuses/{sha}","languages_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/languages","stargazers_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/stargazers","contributors_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/contributors","subscribers_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/subscribers","subscription_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/subscription","commits_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/commits{/sha}","git_commits_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/git/commits{/sha}","comments_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/comments{/number}","issue_comment_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/issues/comments{/number}","contents_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/contents/{+path}","compare_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/merges","archive_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/downloads","issues_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/issues{/number}","pulls_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/pulls{/number}","milestones_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/milestones{/number}","notifications_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/labels{/name}","releases_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/releases{/id}","deployments_url":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/deployments","created_at":"2018-10-01T20:52:44Z","updated_at":"2018-10-01T20:58:19Z","pushed_at":"2018-10-09T21:58:19Z","git_url":"git://github.com/CodingDojoDallas/ruby_oct_2018.git","ssh_url":"git@github.com:CodingDojoDallas/ruby_oct_2018.git","clone_url":"https://github.com/CodingDojoDallas/ruby_oct_2018.git","svn_url":"https://github.com/CodingDojoDallas/ruby_oct_2018","homepage":null,"size":2,"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":6,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":6,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/pulls/2"},"html":{"href":"https://github.com/CodingDojoDallas/ruby_oct_2018/pull/2"},"issue":{"href":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/issues/2"},"comments":{"href":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/CodingDojoDallas/ruby_oct_2018/statuses/3b6353b763ee501f0387f6550fdbdb8c39d572c2"}},"author_association":"NONE"}}
{"actor":{"display_login":"ranriy"}}