|
@ -74,13 +74,17 @@ void main_menu_minesweeper(){ |
|
|
void game_minesweeper(){ |
|
|
void game_minesweeper(){ |
|
|
bool running = true; |
|
|
bool running = true; |
|
|
int x, y, t; |
|
|
int x, y, t; |
|
|
|
|
|
Minesweeper_Board board = initialize_minesweeper(); |
|
|
while (running){ |
|
|
while (running){ |
|
|
Minesweeper_Board board = initialize_minesweeper(); |
|
|
|
|
|
|
|
|
system("clear"); |
|
|
draw_minesweeper(board); |
|
|
draw_minesweeper(board); |
|
|
|
|
|
|
|
|
printf("Next turn (x, y, t(0 = open, 1 = flag)): "); |
|
|
printf("Next turn (x, y, t(0 = open, 1 = flag)): "); |
|
|
scanf("%d %d %d", &x, &y, &t); |
|
|
scanf("%d %d %d", &x, &y, &t); |
|
|
getchar(); |
|
|
getchar(); |
|
|
|
|
|
if(t == 1){board.tiles[x + y * board.width] = board.tiles[x + y * board.width] == EMPTY ? EMPTY : board.tiles[x + y * board.width] == FLAG ? BLOCK : FLAG;} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (t == 2){break;} |
|
|
if (t == 2){break;} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|