void runProgram(char ** mine, char ** status, int width, int height) { int w, h; char **composite; int endGame = 0; while(endGame != 1) { // Takes in original move. If invalid, changed in "placeMove" function printf("Which square do you wish to uncover?\n"); printf("Enter a row and column: "); scanf(" %d %d", &h, &w); placeMove(status, width, height, w, h); system("clear"); composite = makeCompositeBoard(mine, status, width, height); uncoverSquares(composite, mine, status, width, height, w, h); printf(" -------MINESWEEPER-------\n"); printBoard(composite, width, height); printf("\n"); endGame = boardClear(status, mine, width, height); // If there is a winner, the game loop breaks and prints out winning statement if(endGame == 1) break; endGame = bombChosen(composite, width, height); // If a bomb is chosen, "endGame" changes to 1 and the loop breaks } }
void MainWindow::on_automatch_clicked() { boardClear(); field.Turn(0, Figure::cross, false); field.Display(); }
void MainWindow::on_startmatch_clicked() { boardClear(); }