{"action":"created","comment":{"url":"https://api.github.com/repos/trvin51/CS106A/pulls/comments/202570731","pull_request_review_id":137296449,"id":202570731,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjU3MDczMQ==","diff_hunk":"@@ -14,9 +14,37 @@\n \t\n \t/** Amount of space (in pixels) between tiles */\n \tprivate static final int TILE_SPACE = 20;\n+\tprivate static final int TILE_WIDTH = 100;\n+\tprivate static final int TILE_HEIGHT = 50;\n \n \tpublic void run() {","path":"Assignment2/CS106ATiles.java","position":7,"original_position":7,"commit_id":"251c3d1430bd925a91982c6fc8ea771f27de1fdf","original_commit_id":"251c3d1430bd925a91982c6fc8ea771f27de1fdf","user":{"login":"echew7","id":5827338,"node_id":"MDQ6VXNlcjU4MjczMzg=","avatar_url":"https://avatars0.githubusercontent.com/u/5827338?v=4","gravatar_id":"","url":"https://api.github.com/users/echew7","html_url":"https://github.com/echew7","followers_url":"https://api.github.com/users/echew7/followers","following_url":"https://api.github.com/users/echew7/following{/other_user}","gists_url":"https://api.github.com/users/echew7/gists{/gist_id}","starred_url":"https://api.github.com/users/echew7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echew7/subscriptions","organizations_url":"https://api.github.com/users/echew7/orgs","repos_url":"https://api.github.com/users/echew7/repos","events_url":"https://api.github.com/users/echew7/events{/privacy}","received_events_url":"https://api.github.com/users/echew7/received_events","type":"User","site_admin":false},"body":"overall, this is a great approach! one thing to notice tho is that the creation of a rectangle is coupled with the creation of a label, in the sense that you always want to create a label that is centered in a rectangle. therefore, another approach to this problem is to make a `drawLabeledRectangle` method that can create a GRect with a GLabel that is centered inside of it. a method like that would look like this:\r\n\r\n```\r\nprivate void drawLabeledRectangle(double x, double y, double width, double height, String label) {\r\n    GRect rect = new GRect(x, y, width, height);\r\n    add(rect);\r\n    GLabel label = new GLabel(label, x - width / 2, y + height / 2);\r\n    add(label);\r\n}\r\n```\r\n\r\nonce you make this method, the run method becomes something like this:\r\n\r\n```\r\npublic void run() {\r\n    double h = getHeight();\r\n    double w = getWidth();\r\n    double topY = h/2 - TILE_HEIGHT;\r\n    double bottomY = h/2 + TILE_SPACE;\r\n    double leftX = w/2 - TILE_WIDTH - TILE_SPACE/2;\r\n    double rightX = w/2 + TILE_SPACE/2;\r\n    \r\n    drawLabeledRectangle(leftX, topY, TILE_WIDTH, TILE_HEIGHT, \"CS106A\");\r\n    drawLabeledRectangle(rightX, topY, TILE_WIDTH, TILE_HEIGHT, \"CS106A\");\r\n    drawLabeledRectangle(leftX, bottomY, TILE_WIDTH, TILE_HEIGHT, \"CS106A\");\r\n    drawLabeledRectangle(rightX, bottomY, TILE_WIDTH, TILE_HEIGHT, \"CS106A\");\r\n}","created_at":"2018-07-16T04:11:12Z","updated_at":"2018-07-16T04:11:12Z","html_url":"https://github.com/trvin51/CS106A/pull/5#discussion_r202570731","pull_request_url":"https://api.github.com/repos/trvin51/CS106A/pulls/5","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/trvin51/CS106A/pulls/comments/202570731"},"html":{"href":"https://github.com/trvin51/CS106A/pull/5#discussion_r202570731"},"pull_request":{"href":"https://api.github.com/repos/trvin51/CS106A/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/trvin51/CS106A/pulls/5","id":199311324,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5MzExMzI0","html_url":"https://github.com/trvin51/CS106A/pull/5","diff_url":"https://github.com/trvin51/CS106A/pull/5.diff","patch_url":"https://github.com/trvin51/CS106A/pull/5.patch","issue_url":"https://api.github.com/repos/trvin51/CS106A/issues/5","number":5,"state":"open","locked":false,"title":"Assignment 2","user":{"login":"trvin51","id":40647926,"node_id":"MDQ6VXNlcjQwNjQ3OTI2","avatar_url":"https://avatars1.githubusercontent.com/u/40647926?v=4","gravatar_id":"","url":"https://api.github.com/users/trvin51","html_url":"https://github.com/trvin51","followers_url":"https://api.github.com/users/trvin51/followers","following_url":"https://api.github.com/users/trvin51/following{/other_user}","gists_url":"https://api.github.com/users/trvin51/gists{/gist_id}","starred_url":"https://api.github.com/users/trvin51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trvin51/subscriptions","organizations_url":"https://api.github.com/users/trvin51/orgs","repos_url":"https://api.github.com/users/trvin51/repos","events_url":"https://api.github.com/users/trvin51/events{/privacy}","received_events_url":"https://api.github.com/users/trvin51/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-04T19:03:31Z","updated_at":"2018-07-16T04:11:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"echew7","id":5827338,"node_id":"MDQ6VXNlcjU4MjczMzg=","avatar_url":"https://avatars0.githubusercontent.com/u/5827338?v=4","gravatar_id":"","url":"https://api.github.com/users/echew7","html_url":"https://github.com/echew7","followers_url":"https://api.github.com/users/echew7/followers","following_url":"https://api.github.com/users/echew7/following{/other_user}","gists_url":"https://api.github.com/users/echew7/gists{/gist_id}","starred_url":"https://api.github.com/users/echew7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echew7/subscriptions","organizations_url":"https://api.github.com/users/echew7/orgs","repos_url":"https://api.github.com/users/echew7/repos","events_url":"https://api.github.com/users/echew7/events{/privacy}","received_events_url":"https://api.github.com/users/echew7/received_events","type":"User","site_admin":false},"assignees":[{"login":"echew7","id":5827338,"node_id":"MDQ6VXNlcjU4MjczMzg=","avatar_url":"https://avatars0.githubusercontent.com/u/5827338?v=4","gravatar_id":"","url":"https://api.github.com/users/echew7","html_url":"https://github.com/echew7","followers_url":"https://api.github.com/users/echew7/followers","following_url":"https://api.github.com/users/echew7/following{/other_user}","gists_url":"https://api.github.com/users/echew7/gists{/gist_id}","starred_url":"https://api.github.com/users/echew7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echew7/subscriptions","organizations_url":"https://api.github.com/users/echew7/orgs","repos_url":"https://api.github.com/users/echew7/repos","events_url":"https://api.github.com/users/echew7/events{/privacy}","received_events_url":"https://api.github.com/users/echew7/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/trvin51/CS106A/pulls/5/commits","review_comments_url":"https://api.github.com/repos/trvin51/CS106A/pulls/5/comments","review_comment_url":"https://api.github.com/repos/trvin51/CS106A/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trvin51/CS106A/issues/5/comments","statuses_url":"https://api.github.com/repos/trvin51/CS106A/statuses/251c3d1430bd925a91982c6fc8ea771f27de1fdf","head":{"label":"trvin51:assignment2","ref":"assignment2","sha":"251c3d1430bd925a91982c6fc8ea771f27de1fdf","user":{"login":"trvin51","id":40647926,"node_id":"MDQ6VXNlcjQwNjQ3OTI2","avatar_url":"https://avatars1.githubusercontent.com/u/40647926?v=4","gravatar_id":"","url":"https://api.github.com/users/trvin51","html_url":"https://github.com/trvin51","followers_url":"https://api.github.com/users/trvin51/followers","following_url":"https://api.github.com/users/trvin51/following{/other_user}","gists_url":"https://api.github.com/users/trvin51/gists{/gist_id}","starred_url":"https://api.github.com/users/trvin51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trvin51/subscriptions","organizations_url":"https://api.github.com/users/trvin51/orgs","repos_url":"https://api.github.com/users/trvin51/repos","events_url":"https://api.github.com/users/trvin51/events{/privacy}","received_events_url":"https://api.github.com/users/trvin51/received_events","type":"User","site_admin":false},"repo":{"id":138949031,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg5NDkwMzE=","name":"CS106A","full_name":"trvin51/CS106A","owner":{"login":"trvin51","id":40647926,"node_id":"MDQ6VXNlcjQwNjQ3OTI2","avatar_url":"https://avatars1.githubusercontent.com/u/40647926?v=4","gravatar_id":"","url":"https://api.github.com/users/trvin51","html_url":"https://github.com/trvin51","followers_url":"https://api.github.com/users/trvin51/followers","following_url":"https://api.github.com/users/trvin51/following{/other_user}","gists_url":"https://api.github.com/users/trvin51/gists{/gist_id}","starred_url":"https://api.github.com/users/trvin51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trvin51/subscriptions","organizations_url":"https://api.github.com/users/trvin51/orgs","repos_url":"https://api.github.com/users/trvin51/repos","events_url":"https://api.github.com/users/trvin51/events{/privacy}","received_events_url":"https://api.github.com/users/trvin51/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/trvin51/CS106A","description":null,"fork":false,"url":"https://api.github.com/repos/trvin51/CS106A","forks_url":"https://api.github.com/repos/trvin51/CS106A/forks","keys_url":"https://api.github.com/repos/trvin51/CS106A/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trvin51/CS106A/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trvin51/CS106A/teams","hooks_url":"https://api.github.com/repos/trvin51/CS106A/hooks","issue_events_url":"https://api.github.com/repos/trvin51/CS106A/issues/events{/number}","events_url":"https://api.github.com/repos/trvin51/CS106A/events","assignees_url":"https://api.github.com/repos/trvin51/CS106A/assignees{/user}","branches_url":"https://api.github.com/repos/trvin51/CS106A/branches{/branch}","tags_url":"https://api.github.com/repos/trvin51/CS106A/tags","blobs_url":"https://api.github.com/repos/trvin51/CS106A/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trvin51/CS106A/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trvin51/CS106A/git/refs{/sha}","trees_url":"https://api.github.com/repos/trvin51/CS106A/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trvin51/CS106A/statuses/{sha}","languages_url":"https://api.github.com/repos/trvin51/CS106A/languages","stargazers_url":"https://api.github.com/repos/trvin51/CS106A/stargazers","contributors_url":"https://api.github.com/repos/trvin51/CS106A/contributors","subscribers_url":"https://api.github.com/repos/trvin51/CS106A/subscribers","subscription_url":"https://api.github.com/repos/trvin51/CS106A/subscription","commits_url":"https://api.github.com/repos/trvin51/CS106A/commits{/sha}","git_commits_url":"https://api.github.com/repos/trvin51/CS106A/git/commits{/sha}","comments_url":"https://api.github.com/repos/trvin51/CS106A/comments{/number}","issue_comment_url":"https://api.github.com/repos/trvin51/CS106A/issues/comments{/number}","contents_url":"https://api.github.com/repos/trvin51/CS106A/contents/{+path}","compare_url":"https://api.github.com/repos/trvin51/CS106A/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trvin51/CS106A/merges","archive_url":"https://api.github.com/repos/trvin51/CS106A/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trvin51/CS106A/downloads","issues_url":"https://api.github.com/repos/trvin51/CS106A/issues{/number}","pulls_url":"https://api.github.com/repos/trvin51/CS106A/pulls{/number}","milestones_url":"https://api.github.com/repos/trvin51/CS106A/milestones{/number}","notifications_url":"https://api.github.com/repos/trvin51/CS106A/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trvin51/CS106A/labels{/name}","releases_url":"https://api.github.com/repos/trvin51/CS106A/releases{/id}","deployments_url":"https://api.github.com/repos/trvin51/CS106A/deployments","created_at":"2018-06-28T01:02:59Z","updated_at":"2018-06-30T02:19:25Z","pushed_at":"2018-07-15T18:36:58Z","git_url":"git://github.com/trvin51/CS106A.git","ssh_url":"git@github.com:trvin51/CS106A.git","clone_url":"https://github.com/trvin51/CS106A.git","svn_url":"https://github.com/trvin51/CS106A","homepage":null,"size":993,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"trvin51:master","ref":"master","sha":"39ed375e28e17f1aa5a2851c844e6fd5e789d9cb","user":{"login":"trvin51","id":40647926,"node_id":"MDQ6VXNlcjQwNjQ3OTI2","avatar_url":"https://avatars1.githubusercontent.com/u/40647926?v=4","gravatar_id":"","url":"https://api.github.com/users/trvin51","html_url":"https://github.com/trvin51","followers_url":"https://api.github.com/users/trvin51/followers","following_url":"https://api.github.com/users/trvin51/following{/other_user}","gists_url":"https://api.github.com/users/trvin51/gists{/gist_id}","starred_url":"https://api.github.com/users/trvin51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trvin51/subscriptions","organizations_url":"https://api.github.com/users/trvin51/orgs","repos_url":"https://api.github.com/users/trvin51/repos","events_url":"https://api.github.com/users/trvin51/events{/privacy}","received_events_url":"https://api.github.com/users/trvin51/received_events","type":"User","site_admin":false},"repo":{"id":138949031,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg5NDkwMzE=","name":"CS106A","full_name":"trvin51/CS106A","owner":{"login":"trvin51","id":40647926,"node_id":"MDQ6VXNlcjQwNjQ3OTI2","avatar_url":"https://avatars1.githubusercontent.com/u/40647926?v=4","gravatar_id":"","url":"https://api.github.com/users/trvin51","html_url":"https://github.com/trvin51","followers_url":"https://api.github.com/users/trvin51/followers","following_url":"https://api.github.com/users/trvin51/following{/other_user}","gists_url":"https://api.github.com/users/trvin51/gists{/gist_id}","starred_url":"https://api.github.com/users/trvin51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trvin51/subscriptions","organizations_url":"https://api.github.com/users/trvin51/orgs","repos_url":"https://api.github.com/users/trvin51/repos","events_url":"https://api.github.com/users/trvin51/events{/privacy}","received_events_url":"https://api.github.com/users/trvin51/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/trvin51/CS106A","description":null,"fork":false,"url":"https://api.github.com/repos/trvin51/CS106A","forks_url":"https://api.github.com/repos/trvin51/CS106A/forks","keys_url":"https://api.github.com/repos/trvin51/CS106A/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trvin51/CS106A/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trvin51/CS106A/teams","hooks_url":"https://api.github.com/repos/trvin51/CS106A/hooks","issue_events_url":"https://api.github.com/repos/trvin51/CS106A/issues/events{/number}","events_url":"https://api.github.com/repos/trvin51/CS106A/events","assignees_url":"https://api.github.com/repos/trvin51/CS106A/assignees{/user}","branches_url":"https://api.github.com/repos/trvin51/CS106A/branches{/branch}","tags_url":"https://api.github.com/repos/trvin51/CS106A/tags","blobs_url":"https://api.github.com/repos/trvin51/CS106A/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trvin51/CS106A/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trvin51/CS106A/git/refs{/sha}","trees_url":"https://api.github.com/repos/trvin51/CS106A/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trvin51/CS106A/statuses/{sha}","languages_url":"https://api.github.com/repos/trvin51/CS106A/languages","stargazers_url":"https://api.github.com/repos/trvin51/CS106A/stargazers","contributors_url":"https://api.github.com/repos/trvin51/CS106A/contributors","subscribers_url":"https://api.github.com/repos/trvin51/CS106A/subscribers","subscription_url":"https://api.github.com/repos/trvin51/CS106A/subscription","commits_url":"https://api.github.com/repos/trvin51/CS106A/commits{/sha}","git_commits_url":"https://api.github.com/repos/trvin51/CS106A/git/commits{/sha}","comments_url":"https://api.github.com/repos/trvin51/CS106A/comments{/number}","issue_comment_url":"https://api.github.com/repos/trvin51/CS106A/issues/comments{/number}","contents_url":"https://api.github.com/repos/trvin51/CS106A/contents/{+path}","compare_url":"https://api.github.com/repos/trvin51/CS106A/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trvin51/CS106A/merges","archive_url":"https://api.github.com/repos/trvin51/CS106A/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trvin51/CS106A/downloads","issues_url":"https://api.github.com/repos/trvin51/CS106A/issues{/number}","pulls_url":"https://api.github.com/repos/trvin51/CS106A/pulls{/number}","milestones_url":"https://api.github.com/repos/trvin51/CS106A/milestones{/number}","notifications_url":"https://api.github.com/repos/trvin51/CS106A/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trvin51/CS106A/labels{/name}","releases_url":"https://api.github.com/repos/trvin51/CS106A/releases{/id}","deployments_url":"https://api.github.com/repos/trvin51/CS106A/deployments","created_at":"2018-06-28T01:02:59Z","updated_at":"2018-06-30T02:19:25Z","pushed_at":"2018-07-15T18:36:58Z","git_url":"git://github.com/trvin51/CS106A.git","ssh_url":"git@github.com:trvin51/CS106A.git","clone_url":"https://github.com/trvin51/CS106A.git","svn_url":"https://github.com/trvin51/CS106A","homepage":null,"size":993,"stargazers_count":0,"watchers_count":0,"language":"Java","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/trvin51/CS106A/pulls/5"},"html":{"href":"https://github.com/trvin51/CS106A/pull/5"},"issue":{"href":"https://api.github.com/repos/trvin51/CS106A/issues/5"},"comments":{"href":"https://api.github.com/repos/trvin51/CS106A/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/trvin51/CS106A/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/trvin51/CS106A/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trvin51/CS106A/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/trvin51/CS106A/statuses/251c3d1430bd925a91982c6fc8ea771f27de1fdf"}},"author_association":"OWNER"}}
{"actor":{"display_login":"echew7"}}