{"action":"created","comment":{"url":"https://api.github.com/repos/MinionsGroup/devfund-h/pulls/comments/202738491","pull_request_review_id":137494714,"id":202738491,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjczODQ5MQ==","diff_hunk":"@@ -0,0 +1,173 @@\n+package org.minions.devfund.noemiguzman;\n+\n+/**\n+ * Created by Noemi on 11-07-18.\n+ */\n+public class WhackAMole {\n+\n+\n+    private static final char DEFAULTCHARACTER = '*';\n+    private static final String SPACES = \"  \";\n+    private static final char WHACKED = 'W';\n+    private static final char MOLE = 'M';\n+    private static final String NEWLINE = \"\\n\";\n+\n+    // three integer instance variables called score, molesLeft, and attemptsLeft\n+    private int score;\n+    private int molesLeft;\n+    private int attemptsLeft;\n+\n+    // instance variable called moleGrid which is a 2-dimensional array of chars.\n+    private char[][] moleGrid;\n+    private int gridDimension;\n+\n+    /**\n+     * The methods to get the moleGrid.\n+     * @return the char [][]\n+     */\n+    public char[][] getMoleGrid() {\n+\n+        return moleGrid.clone();\n+    }\n+    /**\n+     Constructor for the game, specifies total number of whacks allowed, and the grid dimension.\n+     *\n+     * @param numAttempts numero of attempts.\n+     * @param gridDimension the arrays.\n+     */\n+    public WhackAMole(int numAttempts, int gridDimension) {\n+        attemptsLeft = numAttempts;\n+        this.gridDimension = gridDimension;\n+        this.initializeMoleGrid();\n+    }\n+\n+    /**\n+     * Methods to fill the mole grid for the game whack a mole.\n+     *\n+     */\n+    public void initializeMoleGrid() {\n+        moleGrid = new char[gridDimension][gridDimension];\n+        for (int i = 0; i < gridDimension; i++) {\n+            for (int j = 0; j < moleGrid[i].length; j++) {\n+                moleGrid[i][j] = DEFAULTCHARACTER;\n+            }\n+        }\n+    }\n+\n+    /**\n+     * Given a location, place a mole at that location.\n+     * @param posX position in x.\n+     * @param posY position.\n+     * @return true or false, true if exist mole.\n+     */\n+    public boolean place(int posX, int posY) {\n+        if (moleGrid[posX][posY] != MOLE) {\n+            moleGrid[posX][posY] = MOLE;\n+            molesLeft++;\n+            return true;\n+        }\n+        return false;\n+    }\n+\n+    /**\n+     *  Given a location, take a whack at that location.\n+     *  If that location contains a mole, the score, number of attemptsLeft, and molesLeft is updated.\n+     * @param posX is the location.\n+     * @param posY is the location\n+     */\n+    public void whack(int posX, int posY) {\n+        if (moleGrid[posX][posY] == MOLE) {\n+            updateForScoreMolesLeft();\n+            updateForTheGrid(posX, posY);\n+            return;\n+        }\n+        updateForTheGrid(posX, posY);\n+    }\n+\n+    /**\n+     * This methods update the molesGrid and attemptsLeft.\n+     * @param posX this is the position x.\n+     * @param posY this is the position y.\n+     */\n+    public  void updateForTheGrid(int posX, int posY) {\n+        moleGrid[posX][posY] = WHACKED;\n+        attemptsLeft--;\n+    }\n+\n+    /**\n+     * This method update the score and moles left.\n+     */\n+    public void updateForScoreMolesLeft() {\n+        score++;\n+        molesLeft--;\n+    }\n+\n+    /**\n+     * Methods that print the grid.\n+     * @return grid string.\n+     */\n+    public String printGrid() {\n+        StringBuilder grid = new StringBuilder();\n+        for (char[] row : moleGrid) {\n+            for (char value : row) {\n+                grid.append(String.valueOf(value).concat(SPACES));","path":"src/main/java/org/minions/devfund/noemiguzman/WhackAMole.java","position":113,"original_position":113,"commit_id":"02b78868b76504986fb4925f6a2ffb935064566a","original_commit_id":"02b78868b76504986fb4925f6a2ffb935064566a","user":{"login":"carledriss","id":3298869,"node_id":"MDQ6VXNlcjMyOTg4Njk=","avatar_url":"https://avatars2.githubusercontent.com/u/3298869?v=4","gravatar_id":"","url":"https://api.github.com/users/carledriss","html_url":"https://github.com/carledriss","followers_url":"https://api.github.com/users/carledriss/followers","following_url":"https://api.github.com/users/carledriss/following{/other_user}","gists_url":"https://api.github.com/users/carledriss/gists{/gist_id}","starred_url":"https://api.github.com/users/carledriss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carledriss/subscriptions","organizations_url":"https://api.github.com/users/carledriss/orgs","repos_url":"https://api.github.com/users/carledriss/repos","events_url":"https://api.github.com/users/carledriss/events{/privacy}","received_events_url":"https://api.github.com/users/carledriss/received_events","type":"User","site_admin":false},"body":"String.valueOf is redundant.\r\nconcat method is redundant.\r\nTake advantage of StringBuilder","created_at":"2018-07-16T16:02:57Z","updated_at":"2018-07-16T16:03:59Z","html_url":"https://github.com/MinionsGroup/devfund-h/pull/29#discussion_r202738491","pull_request_url":"https://api.github.com/repos/MinionsGroup/devfund-h/pulls/29","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/MinionsGroup/devfund-h/pulls/comments/202738491"},"html":{"href":"https://github.com/MinionsGroup/devfund-h/pull/29#discussion_r202738491"},"pull_request":{"href":"https://api.github.com/repos/MinionsGroup/devfund-h/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/MinionsGroup/devfund-h/pulls/29","id":201379846,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxMzc5ODQ2","html_url":"https://github.com/MinionsGroup/devfund-h/pull/29","diff_url":"https://github.com/MinionsGroup/devfund-h/pull/29.diff","patch_url":"https://github.com/MinionsGroup/devfund-h/pull/29.patch","issue_url":"https://api.github.com/repos/MinionsGroup/devfund-h/issues/29","number":29,"state":"open","locked":false,"title":"HW1 WhackAMole","user":{"login":"noemiguzo","id":11005527,"node_id":"MDQ6VXNlcjExMDA1NTI3","avatar_url":"https://avatars3.githubusercontent.com/u/11005527?v=4","gravatar_id":"","url":"https://api.github.com/users/noemiguzo","html_url":"https://github.com/noemiguzo","followers_url":"https://api.github.com/users/noemiguzo/followers","following_url":"https://api.github.com/users/noemiguzo/following{/other_user}","gists_url":"https://api.github.com/users/noemiguzo/gists{/gist_id}","starred_url":"https://api.github.com/users/noemiguzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noemiguzo/subscriptions","organizations_url":"https://api.github.com/users/noemiguzo/orgs","repos_url":"https://api.github.com/users/noemiguzo/repos","events_url":"https://api.github.com/users/noemiguzo/events{/privacy}","received_events_url":"https://api.github.com/users/noemiguzo/received_events","type":"User","site_admin":false},"body":"I tried to use Scanner to play, work but not passed  gradle","created_at":"2018-07-13T19:26:44Z","updated_at":"2018-07-16T16:03:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8384fd60907c8c07bbd8a34c0ad72831a761dcfd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/MinionsGroup/devfund-h/pulls/29/commits","review_comments_url":"https://api.github.com/repos/MinionsGroup/devfund-h/pulls/29/comments","review_comment_url":"https://api.github.com/repos/MinionsGroup/devfund-h/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MinionsGroup/devfund-h/issues/29/comments","statuses_url":"https://api.github.com/repos/MinionsGroup/devfund-h/statuses/02b78868b76504986fb4925f6a2ffb935064566a","head":{"label":"MinionsGroup:noemiguzman/hdwhackamole","ref":"noemiguzman/hdwhackamole","sha":"02b78868b76504986fb4925f6a2ffb935064566a","user":{"login":"MinionsGroup","id":38253777,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MjUzNzc3","avatar_url":"https://avatars2.githubusercontent.com/u/38253777?v=4","gravatar_id":"","url":"https://api.github.com/users/MinionsGroup","html_url":"https://github.com/MinionsGroup","followers_url":"https://api.github.com/users/MinionsGroup/followers","following_url":"https://api.github.com/users/MinionsGroup/following{/other_user}","gists_url":"https://api.github.com/users/MinionsGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/MinionsGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MinionsGroup/subscriptions","organizations_url":"https://api.github.com/users/MinionsGroup/orgs","repos_url":"https://api.github.com/users/MinionsGroup/repos","events_url":"https://api.github.com/users/MinionsGroup/events{/privacy}","received_events_url":"https://api.github.com/users/MinionsGroup/received_events","type":"Organization","site_admin":false},"repo":{"id":139185720,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkxODU3MjA=","name":"devfund-h","full_name":"MinionsGroup/devfund-h","owner":{"login":"MinionsGroup","id":38253777,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MjUzNzc3","avatar_url":"https://avatars2.githubusercontent.com/u/38253777?v=4","gravatar_id":"","url":"https://api.github.com/users/MinionsGroup","html_url":"https://github.com/MinionsGroup","followers_url":"https://api.github.com/users/MinionsGroup/followers","following_url":"https://api.github.com/users/MinionsGroup/following{/other_user}","gists_url":"https://api.github.com/users/MinionsGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/MinionsGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MinionsGroup/subscriptions","organizations_url":"https://api.github.com/users/MinionsGroup/orgs","repos_url":"https://api.github.com/users/MinionsGroup/repos","events_url":"https://api.github.com/users/MinionsGroup/events{/privacy}","received_events_url":"https://api.github.com/users/MinionsGroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MinionsGroup/devfund-h","description":null,"fork":false,"url":"https://api.github.com/repos/MinionsGroup/devfund-h","forks_url":"https://api.github.com/repos/MinionsGroup/devfund-h/forks","keys_url":"https://api.github.com/repos/MinionsGroup/devfund-h/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MinionsGroup/devfund-h/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MinionsGroup/devfund-h/teams","hooks_url":"https://api.github.com/repos/MinionsGroup/devfund-h/hooks","issue_events_url":"https://api.github.com/repos/MinionsGroup/devfund-h/issues/events{/number}","events_url":"https://api.github.com/repos/MinionsGroup/devfund-h/events","assignees_url":"https://api.github.com/repos/MinionsGroup/devfund-h/assignees{/user}","branches_url":"https://api.github.com/repos/MinionsGroup/devfund-h/branches{/branch}","tags_url":"https://api.github.com/repos/MinionsGroup/devfund-h/tags","blobs_url":"https://api.github.com/repos/MinionsGroup/devfund-h/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MinionsGroup/devfund-h/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MinionsGroup/devfund-h/git/refs{/sha}","trees_url":"https://api.github.com/repos/MinionsGroup/devfund-h/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MinionsGroup/devfund-h/statuses/{sha}","languages_url":"https://api.github.com/repos/MinionsGroup/devfund-h/languages","stargazers_url":"https://api.github.com/repos/MinionsGroup/devfund-h/stargazers","contributors_url":"https://api.github.com/repos/MinionsGroup/devfund-h/contributors","subscribers_url":"https://api.github.com/repos/MinionsGroup/devfund-h/subscribers","subscription_url":"https://api.github.com/repos/MinionsGroup/devfund-h/subscription","commits_url":"https://api.github.com/repos/MinionsGroup/devfund-h/commits{/sha}","git_commits_url":"https://api.github.com/repos/MinionsGroup/devfund-h/git/commits{/sha}","comments_url":"https://api.github.com/repos/MinionsGroup/devfund-h/comments{/number}","issue_comment_url":"https://api.github.com/repos/MinionsGroup/devfund-h/issues/comments{/number}","contents_url":"https://api.github.com/repos/MinionsGroup/devfund-h/contents/{+path}","compare_url":"https://api.github.com/repos/MinionsGroup/devfund-h/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MinionsGroup/devfund-h/merges","archive_url":"https://api.github.com/repos/MinionsGroup/devfund-h/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MinionsGroup/devfund-h/downloads","issues_url":"https://api.github.com/repos/MinionsGroup/devfund-h/issues{/number}","pulls_url":"https://api.github.com/repos/MinionsGroup/devfund-h/pulls{/number}","milestones_url":"https://api.github.com/repos/MinionsGroup/devfund-h/milestones{/number}","notifications_url":"https://api.github.com/repos/MinionsGroup/devfund-h/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MinionsGroup/devfund-h/labels{/name}","releases_url":"https://api.github.com/repos/MinionsGroup/devfund-h/releases{/id}","deployments_url":"https://api.github.com/repos/MinionsGroup/devfund-h/deployments","created_at":"2018-06-29T19:02:39Z","updated_at":"2018-07-16T15:52:52Z","pushed_at":"2018-07-16T15:52:51Z","git_url":"git://github.com/MinionsGroup/devfund-h.git","ssh_url":"git@github.com:MinionsGroup/devfund-h.git","clone_url":"https://github.com/MinionsGroup/devfund-h.git","svn_url":"https://github.com/MinionsGroup/devfund-h","homepage":null,"size":136,"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":14,"license":null,"forks":0,"open_issues":14,"watchers":0,"default_branch":"develop"}},"base":{"label":"MinionsGroup:develop","ref":"develop","sha":"679083eaf2878469554fe93920c4de67dd9f0ec1","user":{"login":"MinionsGroup","id":38253777,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MjUzNzc3","avatar_url":"https://avatars2.githubusercontent.com/u/38253777?v=4","gravatar_id":"","url":"https://api.github.com/users/MinionsGroup","html_url":"https://github.com/MinionsGroup","followers_url":"https://api.github.com/users/MinionsGroup/followers","following_url":"https://api.github.com/users/MinionsGroup/following{/other_user}","gists_url":"https://api.github.com/users/MinionsGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/MinionsGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MinionsGroup/subscriptions","organizations_url":"https://api.github.com/users/MinionsGroup/orgs","repos_url":"https://api.github.com/users/MinionsGroup/repos","events_url":"https://api.github.com/users/MinionsGroup/events{/privacy}","received_events_url":"https://api.github.com/users/MinionsGroup/received_events","type":"Organization","site_admin":false},"repo":{"id":139185720,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkxODU3MjA=","name":"devfund-h","full_name":"MinionsGroup/devfund-h","owner":{"login":"MinionsGroup","id":38253777,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MjUzNzc3","avatar_url":"https://avatars2.githubusercontent.com/u/38253777?v=4","gravatar_id":"","url":"https://api.github.com/users/MinionsGroup","html_url":"https://github.com/MinionsGroup","followers_url":"https://api.github.com/users/MinionsGroup/followers","following_url":"https://api.github.com/users/MinionsGroup/following{/other_user}","gists_url":"https://api.github.com/users/MinionsGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/MinionsGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MinionsGroup/subscriptions","organizations_url":"https://api.github.com/users/MinionsGroup/orgs","repos_url":"https://api.github.com/users/MinionsGroup/repos","events_url":"https://api.github.com/users/MinionsGroup/events{/privacy}","received_events_url":"https://api.github.com/users/MinionsGroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MinionsGroup/devfund-h","description":null,"fork":false,"url":"https://api.github.com/repos/MinionsGroup/devfund-h","forks_url":"https://api.github.com/repos/MinionsGroup/devfund-h/forks","keys_url":"https://api.github.com/repos/MinionsGroup/devfund-h/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MinionsGroup/devfund-h/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MinionsGroup/devfund-h/teams","hooks_url":"https://api.github.com/repos/MinionsGroup/devfund-h/hooks","issue_events_url":"https://api.github.com/repos/MinionsGroup/devfund-h/issues/events{/number}","events_url":"https://api.github.com/repos/MinionsGroup/devfund-h/events","assignees_url":"https://api.github.com/repos/MinionsGroup/devfund-h/assignees{/user}","branches_url":"https://api.github.com/repos/MinionsGroup/devfund-h/branches{/branch}","tags_url":"https://api.github.com/repos/MinionsGroup/devfund-h/tags","blobs_url":"https://api.github.com/repos/MinionsGroup/devfund-h/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MinionsGroup/devfund-h/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MinionsGroup/devfund-h/git/refs{/sha}","trees_url":"https://api.github.com/repos/MinionsGroup/devfund-h/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MinionsGroup/devfund-h/statuses/{sha}","languages_url":"https://api.github.com/repos/MinionsGroup/devfund-h/languages","stargazers_url":"https://api.github.com/repos/MinionsGroup/devfund-h/stargazers","contributors_url":"https://api.github.com/repos/MinionsGroup/devfund-h/contributors","subscribers_url":"https://api.github.com/repos/MinionsGroup/devfund-h/subscribers","subscription_url":"https://api.github.com/repos/MinionsGroup/devfund-h/subscription","commits_url":"https://api.github.com/repos/MinionsGroup/devfund-h/commits{/sha}","git_commits_url":"https://api.github.com/repos/MinionsGroup/devfund-h/git/commits{/sha}","comments_url":"https://api.github.com/repos/MinionsGroup/devfund-h/comments{/number}","issue_comment_url":"https://api.github.com/repos/MinionsGroup/devfund-h/issues/comments{/number}","contents_url":"https://api.github.com/repos/MinionsGroup/devfund-h/contents/{+path}","compare_url":"https://api.github.com/repos/MinionsGroup/devfund-h/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MinionsGroup/devfund-h/merges","archive_url":"https://api.github.com/repos/MinionsGroup/devfund-h/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MinionsGroup/devfund-h/downloads","issues_url":"https://api.github.com/repos/MinionsGroup/devfund-h/issues{/number}","pulls_url":"https://api.github.com/repos/MinionsGroup/devfund-h/pulls{/number}","milestones_url":"https://api.github.com/repos/MinionsGroup/devfund-h/milestones{/number}","notifications_url":"https://api.github.com/repos/MinionsGroup/devfund-h/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MinionsGroup/devfund-h/labels{/name}","releases_url":"https://api.github.com/repos/MinionsGroup/devfund-h/releases{/id}","deployments_url":"https://api.github.com/repos/MinionsGroup/devfund-h/deployments","created_at":"2018-06-29T19:02:39Z","updated_at":"2018-07-16T15:52:52Z","pushed_at":"2018-07-16T15:52:51Z","git_url":"git://github.com/MinionsGroup/devfund-h.git","ssh_url":"git@github.com:MinionsGroup/devfund-h.git","clone_url":"https://github.com/MinionsGroup/devfund-h.git","svn_url":"https://github.com/MinionsGroup/devfund-h","homepage":null,"size":136,"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":14,"license":null,"forks":0,"open_issues":14,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/MinionsGroup/devfund-h/pulls/29"},"html":{"href":"https://github.com/MinionsGroup/devfund-h/pull/29"},"issue":{"href":"https://api.github.com/repos/MinionsGroup/devfund-h/issues/29"},"comments":{"href":"https://api.github.com/repos/MinionsGroup/devfund-h/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/MinionsGroup/devfund-h/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/MinionsGroup/devfund-h/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MinionsGroup/devfund-h/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/MinionsGroup/devfund-h/statuses/02b78868b76504986fb4925f6a2ffb935064566a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"carledriss"}}