|
@ -308,6 +308,16 @@ int end_check(char** minefield, char** mines, int height, int width) { |
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void free_minefield(char** minefield, int height) { |
|
|
|
|
|
int i; |
|
|
|
|
|
// Free each vector |
|
|
|
|
|
for (i = 0; i < height; i++) { |
|
|
|
|
|
free(minefield[i]); |
|
|
|
|
|
} |
|
|
|
|
|
free(minefield); |
|
|
|
|
|
minefield = NULL; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
int minesweeper() { |
|
|
int minesweeper() { |
|
|
int height, width, row, column; |
|
|
int height, width, row, column; |
|
|
printf("Enter the height of the game field:\n"); |
|
|
printf("Enter the height of the game field:\n"); |
|
@ -369,7 +379,6 @@ int minesweeper() { |
|
|
show_minefield(mines, height, width); |
|
|
show_minefield(mines, height, width); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|