{"action":"created","comment":{"url":"https://api.github.com/repos/KrzysztofDzioba/OX/pulls/comments/188560130","pull_request_review_id":120560624,"id":188560130,"diff_hunk":"@@ -12,11 +12,95 @@ public BoardPrinter(Board board, Journalist journalist) {\n     public void printBoard() {\n         int boardWidth = this.board.dimensions.width;\n         int boardHeight = this.board.dimensions.height;\n-        StringBuilder board = new StringBuilder();\n+        StringBuilder boardToPrint = new StringBuilder();\n+\n+        StringBuilder highestRow = getPrintedHighestRow(boardWidth);\n+        StringBuilder restOfTheBoard = getPrintedRows(boardWidth, boardHeight);\n+\n+        boardToPrint.append(highestRow.toString());\n+        boardToPrint.append(restOfTheBoard.toString());\n+\n+        journalist.sayMessage(boardToPrint.toString());\n+    }\n+\n+    private StringBuilder getPrintedRows(int boardWidth, int boardHeight) {\n+        StringBuilder middleBoard = new StringBuilder();\n+        for(int row = 1; row <= boardHeight; row++) {\n+            middleBoard.append(rowNumber(row));\n+            for(int col = 1; col <= boardWidth; col++) {\n+                Sign currentField = board.getField(row, col);\n+                middleBoard.append(currentField(currentField));\n+            }\n+            middleBoard.append(\"\\n\");\n+        }\n+        return middleBoard;\n+    }\n+\n+    private StringBuilder getPrintedHighestRow(int boardWidth) {\n         StringBuilder highestRow = new StringBuilder();\n-        highestRow.append(\"   |\");\n-        for(int i = 1; i <= boardWidth; i++) {\n-            highestRow.append(\" \" + i + \" |\");\n+        highestRow.append(rowNumber(0));\n+        for(int i = 1; i <= boardWidth; i++)\n+            highestRow.append(colNumber(i));\n+        highestRow.append(\"\\n\");\n+        return highestRow;\n+    }\n+\n+    private String rowNumber(int currentRowNum){\n+        int boardHeight = board.dimensions.height;\n+        int rowDigitNumber = String.valueOf(boardHeight).length();\n+        int currentRowDigitNumber = String.valueOf(currentRowNum).length();\n+        int currentSpaces = rowDigitNumber - currentRowDigitNumber;\n+\n+        StringBuilder builder = new StringBuilder();\n+        builder.append(\" \");\n+        builder.append(currentRowNum);\n+        for(int i = 0; i < currentSpaces; i++)\n+            builder.append(\" \");\n+        builder.append(\" |\");\n+        return builder.toString();\n+    }\n+\n+    private String colNumber(int currentColNum){","path":"src/main/java/edu/dzioba/BoardPrinter.java","position":65,"original_position":56,"commit_id":"f851d4d2b3c5af4af9ce4c089545b62b9125b305","original_commit_id":"cc6f5746b55629ff47dca30d4793c48b21fa6934","user":{"login":"Hoymm","id":18104393,"avatar_url":"https://avatars3.githubusercontent.com/u/18104393?v=4","gravatar_id":"","url":"https://api.github.com/users/Hoymm","html_url":"https://github.com/Hoymm","followers_url":"https://api.github.com/users/Hoymm/followers","following_url":"https://api.github.com/users/Hoymm/following{/other_user}","gists_url":"https://api.github.com/users/Hoymm/gists{/gist_id}","starred_url":"https://api.github.com/users/Hoymm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hoymm/subscriptions","organizations_url":"https://api.github.com/users/Hoymm/orgs","repos_url":"https://api.github.com/users/Hoymm/repos","events_url":"https://api.github.com/users/Hoymm/events{/privacy}","received_events_url":"https://api.github.com/users/Hoymm/received_events","type":"User","site_admin":false},"body":"same as for rowNumber method","created_at":"2018-05-16T09:28:43Z","updated_at":"2018-05-16T09:28:43Z","html_url":"https://github.com/KrzysztofDzioba/OX/pull/25#discussion_r188560130","pull_request_url":"https://api.github.com/repos/KrzysztofDzioba/OX/pulls/25","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/KrzysztofDzioba/OX/pulls/comments/188560130"},"html":{"href":"https://github.com/KrzysztofDzioba/OX/pull/25#discussion_r188560130"},"pull_request":{"href":"https://api.github.com/repos/KrzysztofDzioba/OX/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/KrzysztofDzioba/OX/pulls/25","id":188334369,"html_url":"https://github.com/KrzysztofDzioba/OX/pull/25","diff_url":"https://github.com/KrzysztofDzioba/OX/pull/25.diff","patch_url":"https://github.com/KrzysztofDzioba/OX/pull/25.patch","issue_url":"https://api.github.com/repos/KrzysztofDzioba/OX/issues/25","number":25,"state":"open","locked":false,"title":"Small fixes and tests","user":{"login":"KrzysztofDzioba","id":23156969,"avatar_url":"https://avatars3.githubusercontent.com/u/23156969?v=4","gravatar_id":"","url":"https://api.github.com/users/KrzysztofDzioba","html_url":"https://github.com/KrzysztofDzioba","followers_url":"https://api.github.com/users/KrzysztofDzioba/followers","following_url":"https://api.github.com/users/KrzysztofDzioba/following{/other_user}","gists_url":"https://api.github.com/users/KrzysztofDzioba/gists{/gist_id}","starred_url":"https://api.github.com/users/KrzysztofDzioba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrzysztofDzioba/subscriptions","organizations_url":"https://api.github.com/users/KrzysztofDzioba/orgs","repos_url":"https://api.github.com/users/KrzysztofDzioba/repos","events_url":"https://api.github.com/users/KrzysztofDzioba/events{/privacy}","received_events_url":"https://api.github.com/users/KrzysztofDzioba/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-16T06:53:47Z","updated_at":"2018-05-16T09:28:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"abb13f61582a1706f2a88a45440045977ae31dad","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/KrzysztofDzioba/OX/pulls/25/commits","review_comments_url":"https://api.github.com/repos/KrzysztofDzioba/OX/pulls/25/comments","review_comment_url":"https://api.github.com/repos/KrzysztofDzioba/OX/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KrzysztofDzioba/OX/issues/25/comments","statuses_url":"https://api.github.com/repos/KrzysztofDzioba/OX/statuses/f851d4d2b3c5af4af9ce4c089545b62b9125b305","head":{"label":"KrzysztofDzioba:smallfixesandtests","ref":"smallfixesandtests","sha":"f851d4d2b3c5af4af9ce4c089545b62b9125b305","user":{"login":"KrzysztofDzioba","id":23156969,"avatar_url":"https://avatars3.githubusercontent.com/u/23156969?v=4","gravatar_id":"","url":"https://api.github.com/users/KrzysztofDzioba","html_url":"https://github.com/KrzysztofDzioba","followers_url":"https://api.github.com/users/KrzysztofDzioba/followers","following_url":"https://api.github.com/users/KrzysztofDzioba/following{/other_user}","gists_url":"https://api.github.com/users/KrzysztofDzioba/gists{/gist_id}","starred_url":"https://api.github.com/users/KrzysztofDzioba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrzysztofDzioba/subscriptions","organizations_url":"https://api.github.com/users/KrzysztofDzioba/orgs","repos_url":"https://api.github.com/users/KrzysztofDzioba/repos","events_url":"https://api.github.com/users/KrzysztofDzioba/events{/privacy}","received_events_url":"https://api.github.com/users/KrzysztofDzioba/received_events","type":"User","site_admin":false},"repo":{"id":130983600,"name":"OX","full_name":"KrzysztofDzioba/OX","owner":{"login":"KrzysztofDzioba","id":23156969,"avatar_url":"https://avatars3.githubusercontent.com/u/23156969?v=4","gravatar_id":"","url":"https://api.github.com/users/KrzysztofDzioba","html_url":"https://github.com/KrzysztofDzioba","followers_url":"https://api.github.com/users/KrzysztofDzioba/followers","following_url":"https://api.github.com/users/KrzysztofDzioba/following{/other_user}","gists_url":"https://api.github.com/users/KrzysztofDzioba/gists{/gist_id}","starred_url":"https://api.github.com/users/KrzysztofDzioba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrzysztofDzioba/subscriptions","organizations_url":"https://api.github.com/users/KrzysztofDzioba/orgs","repos_url":"https://api.github.com/users/KrzysztofDzioba/repos","events_url":"https://api.github.com/users/KrzysztofDzioba/events{/privacy}","received_events_url":"https://api.github.com/users/KrzysztofDzioba/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KrzysztofDzioba/OX","description":"Popular XO game in my implementation based on TDD","fork":false,"url":"https://api.github.com/repos/KrzysztofDzioba/OX","forks_url":"https://api.github.com/repos/KrzysztofDzioba/OX/forks","keys_url":"https://api.github.com/repos/KrzysztofDzioba/OX/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KrzysztofDzioba/OX/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KrzysztofDzioba/OX/teams","hooks_url":"https://api.github.com/repos/KrzysztofDzioba/OX/hooks","issue_events_url":"https://api.github.com/repos/KrzysztofDzioba/OX/issues/events{/number}","events_url":"https://api.github.com/repos/KrzysztofDzioba/OX/events","assignees_url":"https://api.github.com/repos/KrzysztofDzioba/OX/assignees{/user}","branches_url":"https://api.github.com/repos/KrzysztofDzioba/OX/branches{/branch}","tags_url":"https://api.github.com/repos/KrzysztofDzioba/OX/tags","blobs_url":"https://api.github.com/repos/KrzysztofDzioba/OX/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KrzysztofDzioba/OX/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KrzysztofDzioba/OX/git/refs{/sha}","trees_url":"https://api.github.com/repos/KrzysztofDzioba/OX/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KrzysztofDzioba/OX/statuses/{sha}","languages_url":"https://api.github.com/repos/KrzysztofDzioba/OX/languages","stargazers_url":"https://api.github.com/repos/KrzysztofDzioba/OX/stargazers","contributors_url":"https://api.github.com/repos/KrzysztofDzioba/OX/contributors","subscribers_url":"https://api.github.com/repos/KrzysztofDzioba/OX/subscribers","subscription_url":"https://api.github.com/repos/KrzysztofDzioba/OX/subscription","commits_url":"https://api.github.com/repos/KrzysztofDzioba/OX/commits{/sha}","git_commits_url":"https://api.github.com/repos/KrzysztofDzioba/OX/git/commits{/sha}","comments_url":"https://api.github.com/repos/KrzysztofDzioba/OX/comments{/number}","issue_comment_url":"https://api.github.com/repos/KrzysztofDzioba/OX/issues/comments{/number}","contents_url":"https://api.github.com/repos/KrzysztofDzioba/OX/contents/{+path}","compare_url":"https://api.github.com/repos/KrzysztofDzioba/OX/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KrzysztofDzioba/OX/merges","archive_url":"https://api.github.com/repos/KrzysztofDzioba/OX/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KrzysztofDzioba/OX/downloads","issues_url":"https://api.github.com/repos/KrzysztofDzioba/OX/issues{/number}","pulls_url":"https://api.github.com/repos/KrzysztofDzioba/OX/pulls{/number}","milestones_url":"https://api.github.com/repos/KrzysztofDzioba/OX/milestones{/number}","notifications_url":"https://api.github.com/repos/KrzysztofDzioba/OX/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KrzysztofDzioba/OX/labels{/name}","releases_url":"https://api.github.com/repos/KrzysztofDzioba/OX/releases{/id}","deployments_url":"https://api.github.com/repos/KrzysztofDzioba/OX/deployments","created_at":"2018-04-25T09:34:28Z","updated_at":"2018-05-15T09:33:00Z","pushed_at":"2018-05-16T06:53:48Z","git_url":"git://github.com/KrzysztofDzioba/OX.git","ssh_url":"git@github.com:KrzysztofDzioba/OX.git","clone_url":"https://github.com/KrzysztofDzioba/OX.git","svn_url":"https://github.com/KrzysztofDzioba/OX","homepage":null,"size":123,"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":20,"license":null,"forks":0,"open_issues":20,"watchers":0,"default_branch":"master"}},"base":{"label":"KrzysztofDzioba:master","ref":"master","sha":"d3c29ba6682076a239a527ab0a2fd2b24ef6c0ef","user":{"login":"KrzysztofDzioba","id":23156969,"avatar_url":"https://avatars3.githubusercontent.com/u/23156969?v=4","gravatar_id":"","url":"https://api.github.com/users/KrzysztofDzioba","html_url":"https://github.com/KrzysztofDzioba","followers_url":"https://api.github.com/users/KrzysztofDzioba/followers","following_url":"https://api.github.com/users/KrzysztofDzioba/following{/other_user}","gists_url":"https://api.github.com/users/KrzysztofDzioba/gists{/gist_id}","starred_url":"https://api.github.com/users/KrzysztofDzioba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrzysztofDzioba/subscriptions","organizations_url":"https://api.github.com/users/KrzysztofDzioba/orgs","repos_url":"https://api.github.com/users/KrzysztofDzioba/repos","events_url":"https://api.github.com/users/KrzysztofDzioba/events{/privacy}","received_events_url":"https://api.github.com/users/KrzysztofDzioba/received_events","type":"User","site_admin":false},"repo":{"id":130983600,"name":"OX","full_name":"KrzysztofDzioba/OX","owner":{"login":"KrzysztofDzioba","id":23156969,"avatar_url":"https://avatars3.githubusercontent.com/u/23156969?v=4","gravatar_id":"","url":"https://api.github.com/users/KrzysztofDzioba","html_url":"https://github.com/KrzysztofDzioba","followers_url":"https://api.github.com/users/KrzysztofDzioba/followers","following_url":"https://api.github.com/users/KrzysztofDzioba/following{/other_user}","gists_url":"https://api.github.com/users/KrzysztofDzioba/gists{/gist_id}","starred_url":"https://api.github.com/users/KrzysztofDzioba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrzysztofDzioba/subscriptions","organizations_url":"https://api.github.com/users/KrzysztofDzioba/orgs","repos_url":"https://api.github.com/users/KrzysztofDzioba/repos","events_url":"https://api.github.com/users/KrzysztofDzioba/events{/privacy}","received_events_url":"https://api.github.com/users/KrzysztofDzioba/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KrzysztofDzioba/OX","description":"Popular XO game in my implementation based on TDD","fork":false,"url":"https://api.github.com/repos/KrzysztofDzioba/OX","forks_url":"https://api.github.com/repos/KrzysztofDzioba/OX/forks","keys_url":"https://api.github.com/repos/KrzysztofDzioba/OX/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KrzysztofDzioba/OX/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KrzysztofDzioba/OX/teams","hooks_url":"https://api.github.com/repos/KrzysztofDzioba/OX/hooks","issue_events_url":"https://api.github.com/repos/KrzysztofDzioba/OX/issues/events{/number}","events_url":"https://api.github.com/repos/KrzysztofDzioba/OX/events","assignees_url":"https://api.github.com/repos/KrzysztofDzioba/OX/assignees{/user}","branches_url":"https://api.github.com/repos/KrzysztofDzioba/OX/branches{/branch}","tags_url":"https://api.github.com/repos/KrzysztofDzioba/OX/tags","blobs_url":"https://api.github.com/repos/KrzysztofDzioba/OX/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KrzysztofDzioba/OX/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KrzysztofDzioba/OX/git/refs{/sha}","trees_url":"https://api.github.com/repos/KrzysztofDzioba/OX/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KrzysztofDzioba/OX/statuses/{sha}","languages_url":"https://api.github.com/repos/KrzysztofDzioba/OX/languages","stargazers_url":"https://api.github.com/repos/KrzysztofDzioba/OX/stargazers","contributors_url":"https://api.github.com/repos/KrzysztofDzioba/OX/contributors","subscribers_url":"https://api.github.com/repos/KrzysztofDzioba/OX/subscribers","subscription_url":"https://api.github.com/repos/KrzysztofDzioba/OX/subscription","commits_url":"https://api.github.com/repos/KrzysztofDzioba/OX/commits{/sha}","git_commits_url":"https://api.github.com/repos/KrzysztofDzioba/OX/git/commits{/sha}","comments_url":"https://api.github.com/repos/KrzysztofDzioba/OX/comments{/number}","issue_comment_url":"https://api.github.com/repos/KrzysztofDzioba/OX/issues/comments{/number}","contents_url":"https://api.github.com/repos/KrzysztofDzioba/OX/contents/{+path}","compare_url":"https://api.github.com/repos/KrzysztofDzioba/OX/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KrzysztofDzioba/OX/merges","archive_url":"https://api.github.com/repos/KrzysztofDzioba/OX/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KrzysztofDzioba/OX/downloads","issues_url":"https://api.github.com/repos/KrzysztofDzioba/OX/issues{/number}","pulls_url":"https://api.github.com/repos/KrzysztofDzioba/OX/pulls{/number}","milestones_url":"https://api.github.com/repos/KrzysztofDzioba/OX/milestones{/number}","notifications_url":"https://api.github.com/repos/KrzysztofDzioba/OX/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KrzysztofDzioba/OX/labels{/name}","releases_url":"https://api.github.com/repos/KrzysztofDzioba/OX/releases{/id}","deployments_url":"https://api.github.com/repos/KrzysztofDzioba/OX/deployments","created_at":"2018-04-25T09:34:28Z","updated_at":"2018-05-15T09:33:00Z","pushed_at":"2018-05-16T06:53:48Z","git_url":"git://github.com/KrzysztofDzioba/OX.git","ssh_url":"git@github.com:KrzysztofDzioba/OX.git","clone_url":"https://github.com/KrzysztofDzioba/OX.git","svn_url":"https://github.com/KrzysztofDzioba/OX","homepage":null,"size":123,"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":20,"license":null,"forks":0,"open_issues":20,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KrzysztofDzioba/OX/pulls/25"},"html":{"href":"https://github.com/KrzysztofDzioba/OX/pull/25"},"issue":{"href":"https://api.github.com/repos/KrzysztofDzioba/OX/issues/25"},"comments":{"href":"https://api.github.com/repos/KrzysztofDzioba/OX/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/KrzysztofDzioba/OX/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/KrzysztofDzioba/OX/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KrzysztofDzioba/OX/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/KrzysztofDzioba/OX/statuses/f851d4d2b3c5af4af9ce4c089545b62b9125b305"}},"author_association":"OWNER"}}
{"actor":{"display_login":"Hoymm"}}