cleaning up

This commit is contained in:
Bernardo Magri
2025-04-10 17:15:14 +01:00
parent 2a1d45f998
commit b5f75a29b7
6 changed files with 252 additions and 281 deletions
-30
View File
@@ -1,30 +0,0 @@
#include "MineField.hpp"
#include <iostream>
int main() {
MineField field(160,160, 100);
srand(time(NULL));
int x = rand() % 160;
int y = rand() % 160;
field.initBombs(x, y);
printf("Opened cell: %i %i\n", x, y);
printf("Neighboor bombs: %i\n", field.bombsNearby(x,y));
while(!field.isGameOver()) {
x = rand() % 160;
y = rand() % 160;
if(field.clearCell(x, y)) {
printf("Opened cell: %i %i\n", x, y);
printf("Neighboor bombs: %i\n", field.bombsNearby(x,y));
}
else {
printf("Bomb found in cell: %i %i\n", x, y);
}
}
}