/*This method sets up the game Board by calculating the number of neighboring mines for each cell.
* calls calculateSurrounding() on each cell
*/
void setupGameBoard(){
int row, col;
row = mineField.size();
col = mineField[0].size();
for(int i = 0; i < row; i++){
for(int j = 0; j < col; j++){
if(mineField[i][j] != 1){
calculateSurrounding(i,j);
}
}
}
}
/* Generates numbers for surrounding tiles of mines. The only
* tiles with numbers are those surrounding mines; these tiles are
* updated as mines are generated.
*/
void calculateSurrounding(int row, int col){
//should update surrounding tiles to reflect presence of adjacent mine
incrementCellValue(row, col);
}
/* increments the cell value(number of mines surrounding it) if the input location is valid
* called from calculateSurrounding() for each adjacent mine.
*/
void incrementCellValue(int row, int col){
}
Here, I need to populate the mine Field with mines randomly (which I have already done), and then set up the game board by calculating the number of neighboring mines for each cell(which is what I'm having trouble doing, I can't figure out how to start). (1 = mine)