Hi guys, I'm doing a bit of learning and I have been trying to figure out how to set bomb placements manually for test purposes, could someone please assist? the code at GitHub, https://github.com/sfxhewitt/BombAvoider2/blob/master/Code
File contents:
.....B.
.B.....
....B..
.......
..B....
.B...B.
.......
// ctor for Board that reads from a file
Board(constchar *filename) {
ifstream fin(filename);
string line;
int r = 0;
while (getline(fin, line)) {
int c = 0;
for (char ch: line) {
Square sq(r+1, c+1);
// ... and add to map ...
//BTW, Square's ctor should be initializing hidden and marker.
if (ch == 'B') {
// setbomb(true) in map
numbombs++;
}
else
// setbomb(false) in map
++c;
}
++r;
}
}