MCPcopy Index your code
hub / github.com/careercup/ctci / printBoard

Method printBoard

java/Chapter 9/Question9_9/Question.java:54–69  ·  view source on GitHub ↗
(Integer[] columns)

Source from the content-addressed store, hash-verified

52 }
53
54 public static void printBoard(Integer[] columns) {
55 drawLine();
56 for(int i = 0; i < GRID_SIZE; i++){
57 System.out.print("|");
58 for (int j = 0; j < GRID_SIZE; j++){
59 if (columns[i] == j) {
60 System.out.print("Q|");
61 } else {
62 System.out.print(" |");
63 }
64 }
65 System.out.print("\n");
66 drawLine();
67 }
68 System.out.println("");
69 }
70
71 private static void drawLine() {
72 StringBuilder line = new StringBuilder();

Callers 1

printBoardsMethod · 0.95

Calls 2

drawLineMethod · 0.95
printMethod · 0.45

Tested by

no test coverage detected