{"action":"created","comment":{"url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/pulls/comments/53559896","id":53559896,"diff_hunk":"@@ -0,0 +1,155 @@\n+package edu.htc.tictactoe;\r\n+\r\n+import java.util.ArrayList;\r\n+\r\n+/**\r\n+ * Created by KenN on 2/9/16.\r\n+ */\r\n+\r\n+public class GameBoard {\r\n+    ArrayList<Integer> openSquares;\r\n+    char[] board = {'1', '2', '3', '4', '5', '6', '7', '8', '9'};\r\n+    int[][] winCombinations = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {1, 4, 7}, {2, 5, 8}, {3, 6, 9}, {1, 5, 9}, {3, 5, 7}};\r\n+\r\n+\r\n+    public GameBoard() {   //initialize gameboard array\r\n+        int x;\r\n+\r\n+        openSquares = new ArrayList<Integer>(9);\r\n+        for (x = 1; x < 10; x++) {\r\n+            openSquares.add(x);\r\n+        }\r\n+    }\r\n+\r\n+//    public static void main(String[] args){\r\n+//        GameBoard gb = new GameBoard();\r\n+//        gb.testGameboard();\r\n+//\r\n+//    }\r\n+\r\n+    public void display() {\r\n+        int x;\r\n+\r\n+        System.out.println(\" *************\");\r\n+        for (x = 0; x < 3; x++) {\r\n+            System.out.print(\" | \" + board[x]);\r\n+        }\r\n+        System.out.println(\" |\");\r\n+        System.out.println(\" |---+---+---|\");\r\n+        for (x = 3; x < 6; x++) {\r\n+            System.out.print(\" | \" + board[x]);\r\n+        }\r\n+        ;\r\n+        System.out.println(\" |\");\r\n+        System.out.println(\" |---+---+---|\");\r\n+        for (x = 6; x < 9; x++) {\r\n+            System.out.print(\" | \" + board[x]);\r\n+        }\r\n+        System.out.println(\" |\");\r\n+        System.out.println(\" *************\");\r\n+    }\r\n+    /*\r\n+    Using last input from the user to scan the board array for that square and determine if that array contains the same\r\n+    player mark for all members within that sub array and if so return true\r\n+     */\r\n+    public boolean isGameWon(int lastMove, char playerMark) {\r\n+\r\n+        boolean result = false;\r\n+        int x, y, z;\r\n+\r\n+        for (x = 0; x < winCombinations.length; x++) {\r\n+            for (y = 0; y < 3; y++) {\r\n+                if (winCombinations[x][y] == lastMove) {\r\n+                    if (board[winCombinations[x][0] - 1] == playerMark &&\r\n+                            board[winCombinations[x][1] - 1] == playerMark &&\r\n+                            board[winCombinations[x][2] - 1] == playerMark) {\r\n+                        result = true;\r\n+                        break;\r\n+                    }\r\n+                }\r\n+            }\r\n+        }\r\n+        return result;\r\n+    }\r\n+\r\n+    public int[] getOpenSquares() {\r\n+\r\n+        int[] intArray = openSquares.parallelStream().mapToInt(Integer::intValue).toArray();\r\n+\r\n+        return intArray;\r\n+    }\r\n+\r\n+    public boolean isSquareOpen(int open) {\r\n+        boolean squareIsOpen;\r\n+\r\n+        squareIsOpen = openSquares.contains(new Integer(open));\r\n+        if (squareIsOpen) {\r\n+            return true;\r\n+        } else {\r\n+            System.out.println(\"Sorry the square you selected is not available, try again.\");\r\n+            return false;\r\n+        }\r\n+    }\r\n+\r\n+    public void updateSquareValue(int number, char playerMark) {\r\n+        this.board[number - 1] = playerMark;\r\n+        openSquares.remove(new Integer(number));\r\n+    }\r\n+\r\n+    public char getSquareValue(int square) {\r\n+        return this.board[square];\r\n+        //not sure why we need this\r\n+    }\r\n+\r\n+    public void testGameboard(){\r","path":"src/edu/htc/tictactoe/GameBoard.java","position":104,"original_position":104,"commit_id":"80cbc3f9207383fd9fcd723a04abb58e5b9cc077","original_commit_id":"80cbc3f9207383fd9fcd723a04abb58e5b9cc077","user":{"login":"mbMosman","id":5143491,"avatar_url":"https://avatars.githubusercontent.com/u/5143491?v=3","gravatar_id":"","url":"https://api.github.com/users/mbMosman","html_url":"https://github.com/mbMosman","followers_url":"https://api.github.com/users/mbMosman/followers","following_url":"https://api.github.com/users/mbMosman/following{/other_user}","gists_url":"https://api.github.com/users/mbMosman/gists{/gist_id}","starred_url":"https://api.github.com/users/mbMosman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbMosman/subscriptions","organizations_url":"https://api.github.com/users/mbMosman/orgs","repos_url":"https://api.github.com/users/mbMosman/repos","events_url":"https://api.github.com/users/mbMosman/events{/privacy}","received_events_url":"https://api.github.com/users/mbMosman/received_events","type":"User","site_admin":false},"body":"ah!  I see that you're testing a few different things in there.  I missed that initially.  It might be better to split this up so that there is a separate method to test each part.  Otherwise, you should make this a private method, so it is only used here in this class.\r\n","created_at":"2016-02-21T00:59:12Z","updated_at":"2016-02-21T00:59:12Z","html_url":"https://github.com/htc-ccis2595/tic-tac-toe/pull/1#discussion_r53559896","pull_request_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/pulls/comments/53559896"},"html":{"href":"https://github.com/htc-ccis2595/tic-tac-toe/pull/1#discussion_r53559896"},"pull_request":{"href":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/pulls/1","id":60039180,"html_url":"https://github.com/htc-ccis2595/tic-tac-toe/pull/1","diff_url":"https://github.com/htc-ccis2595/tic-tac-toe/pull/1.diff","patch_url":"https://github.com/htc-ccis2595/tic-tac-toe/pull/1.patch","issue_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/issues/1","number":1,"state":"open","locked":false,"title":"tic tac toe game","user":{"login":"kknagel","id":16657854,"avatar_url":"https://avatars.githubusercontent.com/u/16657854?v=3","gravatar_id":"","url":"https://api.github.com/users/kknagel","html_url":"https://github.com/kknagel","followers_url":"https://api.github.com/users/kknagel/followers","following_url":"https://api.github.com/users/kknagel/following{/other_user}","gists_url":"https://api.github.com/users/kknagel/gists{/gist_id}","starred_url":"https://api.github.com/users/kknagel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kknagel/subscriptions","organizations_url":"https://api.github.com/users/kknagel/orgs","repos_url":"https://api.github.com/users/kknagel/repos","events_url":"https://api.github.com/users/kknagel/events{/privacy}","received_events_url":"https://api.github.com/users/kknagel/received_events","type":"User","site_admin":false},"body":"java is fun","created_at":"2016-02-20T05:58:32Z","updated_at":"2016-02-21T00:59:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c42caaa063bdf52d0104900192658de71575dcd0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/pulls/1/commits","review_comments_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/pulls/1/comments","review_comment_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/issues/1/comments","statuses_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/statuses/80cbc3f9207383fd9fcd723a04abb58e5b9cc077","head":{"label":"kknagel:master","ref":"master","sha":"80cbc3f9207383fd9fcd723a04abb58e5b9cc077","user":{"login":"kknagel","id":16657854,"avatar_url":"https://avatars.githubusercontent.com/u/16657854?v=3","gravatar_id":"","url":"https://api.github.com/users/kknagel","html_url":"https://github.com/kknagel","followers_url":"https://api.github.com/users/kknagel/followers","following_url":"https://api.github.com/users/kknagel/following{/other_user}","gists_url":"https://api.github.com/users/kknagel/gists{/gist_id}","starred_url":"https://api.github.com/users/kknagel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kknagel/subscriptions","organizations_url":"https://api.github.com/users/kknagel/orgs","repos_url":"https://api.github.com/users/kknagel/repos","events_url":"https://api.github.com/users/kknagel/events{/privacy}","received_events_url":"https://api.github.com/users/kknagel/received_events","type":"User","site_admin":false},"repo":{"id":51344232,"name":"tic-tac-toe","full_name":"kknagel/tic-tac-toe","owner":{"login":"kknagel","id":16657854,"avatar_url":"https://avatars.githubusercontent.com/u/16657854?v=3","gravatar_id":"","url":"https://api.github.com/users/kknagel","html_url":"https://github.com/kknagel","followers_url":"https://api.github.com/users/kknagel/followers","following_url":"https://api.github.com/users/kknagel/following{/other_user}","gists_url":"https://api.github.com/users/kknagel/gists{/gist_id}","starred_url":"https://api.github.com/users/kknagel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kknagel/subscriptions","organizations_url":"https://api.github.com/users/kknagel/orgs","repos_url":"https://api.github.com/users/kknagel/repos","events_url":"https://api.github.com/users/kknagel/events{/privacy}","received_events_url":"https://api.github.com/users/kknagel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kknagel/tic-tac-toe","description":"Project 1 - TicTacToe","fork":true,"url":"https://api.github.com/repos/kknagel/tic-tac-toe","forks_url":"https://api.github.com/repos/kknagel/tic-tac-toe/forks","keys_url":"https://api.github.com/repos/kknagel/tic-tac-toe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kknagel/tic-tac-toe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kknagel/tic-tac-toe/teams","hooks_url":"https://api.github.com/repos/kknagel/tic-tac-toe/hooks","issue_events_url":"https://api.github.com/repos/kknagel/tic-tac-toe/issues/events{/number}","events_url":"https://api.github.com/repos/kknagel/tic-tac-toe/events","assignees_url":"https://api.github.com/repos/kknagel/tic-tac-toe/assignees{/user}","branches_url":"https://api.github.com/repos/kknagel/tic-tac-toe/branches{/branch}","tags_url":"https://api.github.com/repos/kknagel/tic-tac-toe/tags","blobs_url":"https://api.github.com/repos/kknagel/tic-tac-toe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kknagel/tic-tac-toe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kknagel/tic-tac-toe/git/refs{/sha}","trees_url":"https://api.github.com/repos/kknagel/tic-tac-toe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kknagel/tic-tac-toe/statuses/{sha}","languages_url":"https://api.github.com/repos/kknagel/tic-tac-toe/languages","stargazers_url":"https://api.github.com/repos/kknagel/tic-tac-toe/stargazers","contributors_url":"https://api.github.com/repos/kknagel/tic-tac-toe/contributors","subscribers_url":"https://api.github.com/repos/kknagel/tic-tac-toe/subscribers","subscription_url":"https://api.github.com/repos/kknagel/tic-tac-toe/subscription","commits_url":"https://api.github.com/repos/kknagel/tic-tac-toe/commits{/sha}","git_commits_url":"https://api.github.com/repos/kknagel/tic-tac-toe/git/commits{/sha}","comments_url":"https://api.github.com/repos/kknagel/tic-tac-toe/comments{/number}","issue_comment_url":"https://api.github.com/repos/kknagel/tic-tac-toe/issues/comments{/number}","contents_url":"https://api.github.com/repos/kknagel/tic-tac-toe/contents/{+path}","compare_url":"https://api.github.com/repos/kknagel/tic-tac-toe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kknagel/tic-tac-toe/merges","archive_url":"https://api.github.com/repos/kknagel/tic-tac-toe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kknagel/tic-tac-toe/downloads","issues_url":"https://api.github.com/repos/kknagel/tic-tac-toe/issues{/number}","pulls_url":"https://api.github.com/repos/kknagel/tic-tac-toe/pulls{/number}","milestones_url":"https://api.github.com/repos/kknagel/tic-tac-toe/milestones{/number}","notifications_url":"https://api.github.com/repos/kknagel/tic-tac-toe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kknagel/tic-tac-toe/labels{/name}","releases_url":"https://api.github.com/repos/kknagel/tic-tac-toe/releases{/id}","deployments_url":"https://api.github.com/repos/kknagel/tic-tac-toe/deployments","created_at":"2016-02-09T03:20:58Z","updated_at":"2016-02-09T03:20:59Z","pushed_at":"2016-02-20T05:55:34Z","git_url":"git://github.com/kknagel/tic-tac-toe.git","ssh_url":"git@github.com:kknagel/tic-tac-toe.git","clone_url":"https://github.com/kknagel/tic-tac-toe.git","svn_url":"https://github.com/kknagel/tic-tac-toe","homepage":null,"size":7,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"htc-ccis2595:master","ref":"master","sha":"bc827532dfa7435306d9fef673a4b43dec62dab5","user":{"login":"htc-ccis2595","id":16569798,"avatar_url":"https://avatars.githubusercontent.com/u/16569798?v=3","gravatar_id":"","url":"https://api.github.com/users/htc-ccis2595","html_url":"https://github.com/htc-ccis2595","followers_url":"https://api.github.com/users/htc-ccis2595/followers","following_url":"https://api.github.com/users/htc-ccis2595/following{/other_user}","gists_url":"https://api.github.com/users/htc-ccis2595/gists{/gist_id}","starred_url":"https://api.github.com/users/htc-ccis2595/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htc-ccis2595/subscriptions","organizations_url":"https://api.github.com/users/htc-ccis2595/orgs","repos_url":"https://api.github.com/users/htc-ccis2595/repos","events_url":"https://api.github.com/users/htc-ccis2595/events{/privacy}","received_events_url":"https://api.github.com/users/htc-ccis2595/received_events","type":"Organization","site_admin":false},"repo":{"id":51336298,"name":"tic-tac-toe","full_name":"htc-ccis2595/tic-tac-toe","owner":{"login":"htc-ccis2595","id":16569798,"avatar_url":"https://avatars.githubusercontent.com/u/16569798?v=3","gravatar_id":"","url":"https://api.github.com/users/htc-ccis2595","html_url":"https://github.com/htc-ccis2595","followers_url":"https://api.github.com/users/htc-ccis2595/followers","following_url":"https://api.github.com/users/htc-ccis2595/following{/other_user}","gists_url":"https://api.github.com/users/htc-ccis2595/gists{/gist_id}","starred_url":"https://api.github.com/users/htc-ccis2595/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htc-ccis2595/subscriptions","organizations_url":"https://api.github.com/users/htc-ccis2595/orgs","repos_url":"https://api.github.com/users/htc-ccis2595/repos","events_url":"https://api.github.com/users/htc-ccis2595/events{/privacy}","received_events_url":"https://api.github.com/users/htc-ccis2595/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/htc-ccis2595/tic-tac-toe","description":"Project 1 - TicTacToe","fork":false,"url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe","forks_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/forks","keys_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/teams","hooks_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/hooks","issue_events_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/issues/events{/number}","events_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/events","assignees_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/assignees{/user}","branches_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/branches{/branch}","tags_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/tags","blobs_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/git/refs{/sha}","trees_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/statuses/{sha}","languages_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/languages","stargazers_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/stargazers","contributors_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/contributors","subscribers_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/subscribers","subscription_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/subscription","commits_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/commits{/sha}","git_commits_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/git/commits{/sha}","comments_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/comments{/number}","issue_comment_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/issues/comments{/number}","contents_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/contents/{+path}","compare_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/merges","archive_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/downloads","issues_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/issues{/number}","pulls_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/pulls{/number}","milestones_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/milestones{/number}","notifications_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/labels{/name}","releases_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/releases{/id}","deployments_url":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/deployments","created_at":"2016-02-08T23:58:56Z","updated_at":"2016-02-09T00:01:10Z","pushed_at":"2016-02-20T05:58:33Z","git_url":"git://github.com/htc-ccis2595/tic-tac-toe.git","ssh_url":"git@github.com:htc-ccis2595/tic-tac-toe.git","clone_url":"https://github.com/htc-ccis2595/tic-tac-toe.git","svn_url":"https://github.com/htc-ccis2595/tic-tac-toe","homepage":null,"size":1,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":1,"forks":11,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/pulls/1"},"html":{"href":"https://github.com/htc-ccis2595/tic-tac-toe/pull/1"},"issue":{"href":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/issues/1"},"comments":{"href":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/htc-ccis2595/tic-tac-toe/statuses/80cbc3f9207383fd9fcd723a04abb58e5b9cc077"}}}}