Browse Source

marking and unmarking flags

remotes/origin/David
David Moeller 11 months ago
parent
commit
a910d7d709
  1. 6
      src/main/c/Minesweeper/minesweeper_start.c

6
src/main/c/Minesweeper/minesweeper_start.c

@ -74,13 +74,17 @@ void main_menu_minesweeper(){
void game_minesweeper(){
bool running = true;
int x, y, t;
Minesweeper_Board board = initialize_minesweeper();
while (running){
Minesweeper_Board board = initialize_minesweeper();
system("clear");
draw_minesweeper(board);
printf("Next turn (x, y, t(0 = open, 1 = flag)): ");
scanf("%d %d %d", &x, &y, &t);
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;}
}
}

Loading…
Cancel
Save