Returns a string representation of the board, replacing 'Q' with "Qu". @return a string representation of the board, replacing 'Q' with "Qu"
()
| 179 | * @return a string representation of the board, replacing 'Q' with "Qu" |
| 180 | */ |
| 181 | public String toString() { |
| 182 | StringBuilder sb = new StringBuilder(m + " " + n + "\n"); |
| 183 | for (int i = 0; i < m; i++) { |
| 184 | for (int j = 0; j < n; j++) { |
| 185 | sb.append(board[i][j]); |
| 186 | if (board[i][j] == 'Q') sb.append("u "); |
| 187 | else sb.append(" "); |
| 188 | } |
| 189 | sb.append("\n"); |
| 190 | } |
| 191 | return sb.toString().trim(); |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * Unit tests the BoggleBoard data type. |
no outgoing calls
no test coverage detected