|
@ -310,6 +310,17 @@ int minesweeper() { |
|
|
char** minefield = create_minefield(height, width, unknown_character); |
|
|
char** minefield = create_minefield(height, width, unknown_character); |
|
|
char** mines = create_minefield(height, width, 0); |
|
|
char** mines = create_minefield(height, width, 0); |
|
|
distribute_mines(mines, height, width, num_mines); |
|
|
distribute_mines(mines, height, width, num_mines); |
|
|
|
|
|
while (1) { |
|
|
|
|
|
|
|
|
|
|
|
printf("Enter 'row column' to uncover (to quit enter '0 0'):\n"); |
|
|
|
|
|
if (scanf("%d %d", &row, &column) != 2) { |
|
|
|
|
|
printf("Incorrect input!\n"); |
|
|
|
|
|
return 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
row--; |
|
|
|
|
|
column--; |
|
|
|
|
|
|
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|