preview

Questions On ' The Void '

Decent Essays

#include #include #include #include #define BOARD_SIZE 6 #define TRUE 0 #define FALSE 1 char board[BOARD_SIZE][BOARD_SIZE]; char game_board[BOARD_SIZE][BOARD_SIZE]; int lost = 0; void hidden_mine_board(); void final_game_board(); void all_the_mines(); void begin_the_board(); void show_it_all(); void begin(); int play_on(); void want_a_rematch(); int check_win(); void check_for_mine(int, int); int check_for_nearby_mines(int, int); int main() { printf("Hannah Switch, 112899916, Final Project "); printf("This program allows you to play a simplified version of Minesweeper through terminal input. "); printf("Press enter to play!"); getchar(); begin(); return 0;} void hidden_mine_board() //creates random mines { int i, j; for(i = 0; i < BOARD_SIZE; i++) for(j = 0; j < BOARD_SIZE; j++) board[i][j] = 'o '; all_the_mines();} void final_game_board() { //creates the game board the player sees int i, j; int row, col; printf("PLAY! "); for(i = 0; i < BOARD_SIZE; i++) for(j = 0; j < BOARD_SIZE; j++) game_board[i][j] = 'o '; for(col = 0; col < BOARD_SIZE; col++) printf("%d ", col + 1); printf(" "); for(row = 0; row < BOARD_SIZE; row++){ for(col = 0; col < BOARD_SIZE; col++){ printf("%c ", game_board[row][col]);} printf(" %d ", row + 1); printf(" ");}} void all_the_mines(){ int i, random;

Get Access