Hi everyone,
I'm working on method to fill a 2D grid with objects. This is what I have at the moment:
public void fillGrid() {
for(int i = 0; i < ROWS; i++) {
for(int j = 0; j < COLUMNS; j++) {
String displayText = "#";
board[i][j] = new objPiece(displayText);
}
}
}
board = new objPiece[8][8];
What does 'design for flexibility' mean for this method? It is expected that this method will fill in different objPiece in later updates (maybe an objPiece with a display string of "@" or "*" or "$" on different locations in the grid).
All ideas are welcome :)