{"comment":{"url":"https://api.github.com/repos/shmuelr/touro-mco152/comments/10149804","html_url":"https://github.com/shmuelr/touro-mco152/commit/8555fd8d7a4d0e98b26e8d9a400ab8bea83bb8c0#commitcomment-10149804","id":10149804,"user":{"login":"maric1","id":10280820,"avatar_url":"https://avatars.githubusercontent.com/u/10280820?v=3","gravatar_id":"","url":"https://api.github.com/users/maric1","html_url":"https://github.com/maric1","followers_url":"https://api.github.com/users/maric1/followers","following_url":"https://api.github.com/users/maric1/following{/other_user}","gists_url":"https://api.github.com/users/maric1/gists{/gist_id}","starred_url":"https://api.github.com/users/maric1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maric1/subscriptions","organizations_url":"https://api.github.com/users/maric1/orgs","repos_url":"https://api.github.com/users/maric1/repos","events_url":"https://api.github.com/users/maric1/events{/privacy}","received_events_url":"https://api.github.com/users/maric1/received_events","type":"User","site_admin":false},"position":119,"line":109,"path":"Chess/src/edu/touro/mco152/Board.java","commit_id":"8555fd8d7a4d0e98b26e8d9a400ab8bea83bb8c0","created_at":"2015-03-11T18:54:54Z","updated_at":"2015-03-11T18:54:54Z","body":"This happens because if you would use pieces[i][j], your inner for loop would be appending the values of the first column instead of the first row. I suggest to modify for clarification. \r\n\r\nfor(int y = 0; y < DEFAULT_BOARD_SIZE; y++){\r\n\t\t\tstringBuilder.append(DEFAULT_BOARD_SIZE - y);\r\n\t\t\tstringBuilder.append(\" \");\r\n\t\t\t\r\n\t\t\tfor(int x = 0; x< DEFAULT_BOARD_SIZE; x++){\r\n\t\t\t\t\r\n\t\t\t\t// I'm not sure why I have to reverse i and j to get it to print out correctly\r\n\t\t\t\t// Need to investigate\r\n\t\t\t\tif(pieces[x][y]!=null){\r\n\t\t\t\t\tstringBuilder.append(pieces[x][y].toString());\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstringBuilder.append('.');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tstringBuilder.append(\"\\n\");\r\n\t\t}"}}