Created
March 13, 2019 17:21
-
-
Save kleberksms/79462b7ed4dc327ccd712ef86744531b to your computer and use it in GitHub Desktop.
One level of indentation per method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Board | |
| { | |
| ... | |
| String board() | |
| { | |
| StringBuffer buf = new StringBuffer(); | |
| collectRows(buf); | |
| return buf.toString(); | |
| } | |
| void collectRows(StringBuffer buf) | |
| { | |
| for (int i = 0; i < 10; i++) | |
| { | |
| collectRow(buf, i); | |
| } | |
| } | |
| void collectRow(StringBuffer buf, int row) | |
| { | |
| for (int i = 0; i < 10; i++) | |
| { | |
| buf.append(data[row][i]); | |
| } | |
| buf.append("\n"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment