diff --git a/src/main/c/Minesweeper/minesweeper_start.c b/src/main/c/Minesweeper/minesweeper_start.c index fae882a..4a0c0e7 100644 --- a/src/main/c/Minesweeper/minesweeper_start.c +++ b/src/main/c/Minesweeper/minesweeper_start.c @@ -189,6 +189,9 @@ bool array_contains_value(int *array, int value, int length){ } void draw_minesweeper(Minesweeper_Board *board){ + int s = 0; + for(int i = 0; i < board->height * board->width; i++){s += board->tiles[i] == FLAG ? 1 : 0;} + printf("Score: %d\n", s); printf(" "); for(int i = 0; i < board->width; i++){printf("%d", i / 10);} printf("\n "); @@ -214,8 +217,7 @@ void draw_minesweeper(Minesweeper_Board *board){ int open_tile(Minesweeper_Board *board, int tile){ if(array_contains_value(board->bombs, tile, board->num_bombs)){return -1;} - int num = number_of_bombs(board, tile); - if(1){return num;} + return number_of_bombs(board, tile); } int number_of_bombs(Minesweeper_Board *board, int tile){