@@ -7,16 +7,16 @@ public class SudokuPrinter {
|
||||
public static void printRectangleSudoku(final Sudoku s, int blockWidth, int blockHeight) {
|
||||
for (int y = 0; y < s.getSize(); y++) {
|
||||
if (y % blockHeight == 0 && y > 0) {
|
||||
System.out.println("");
|
||||
System.out.println();
|
||||
}
|
||||
String line = "[ ";
|
||||
StringBuilder line = new StringBuilder("[ ");
|
||||
for (int x = 0; x < s.getSize(); x++) {
|
||||
line += (s.getCell(x, y).getSymbolIndex() + 1) + " ";
|
||||
line.append((s.getCell(x, y).getSymbolIndex() + 1)).append(" ");
|
||||
if (x % blockWidth == blockWidth - 1 && x != blockWidth * blockHeight - 1) {
|
||||
line += "| ";
|
||||
line.append("| ");
|
||||
}
|
||||
}
|
||||
line += "]";
|
||||
line.append("]");
|
||||
System.out.println(line);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user