Untitled
public text v1 · immutablefor (int i = 0; i < grid.length(); i++) {
for (int j = 0; j < grid[i].length(); j++) {
//if (this square contains pirates) grid[i][j] = (red color object)
//else if (this square contains ninjas) grid[i][j] = (blue color object)
// else (neither pirates nor ninjas) grid[i][j] = black color object
}
}