commit 1f4b3dfc4d63e89c6dc418963bc93f3199368c24 parent 8805d2440c3ba7aa18c26232b4a9f68020774e00 Author: Christos Margiolis <christos@margiolis.net> Date: Tue, 21 Jan 2020 00:47:12 +0200 made changes in minesweeper Diffstat:
10 files changed, 26 insertions(+), 30 deletions(-)
diff --git a/assignment-1.5-arrays-pointers-files/minesweeper/bin/minesweeper b/assignment-1.5-arrays-pointers-files/minesweeper/bin/minesweeper Binary files differ. diff --git a/assignment-1.5-arrays-pointers-files/minesweeper/include/minesweeper.h b/assignment-1.5-arrays-pointers-files/minesweeper/include/minesweeper.h @@ -20,9 +20,7 @@ #define MINE '*' #define CLEAR " " -void main_win(); void start(); - void game_win(int, int, int); char **init_dispboard(struct _win_st*, int, int); void fill_dispboard(char **, int, int); diff --git a/assignment-1.5-arrays-pointers-files/minesweeper/include/settings.h b/assignment-1.5-arrays-pointers-files/minesweeper/include/settings.h @@ -3,6 +3,7 @@ #include "minesweeper.h" +void main_win(); void set_mode(struct _win_st*); int set_cols(struct _win_st*, int); int set_rows(struct _win_st*, int); diff --git a/assignment-1.5-arrays-pointers-files/minesweeper/mnsout.txt b/assignment-1.5-arrays-pointers-files/minesweeper/mnsout.txt @@ -1,9 +1,9 @@ -Mine hit at position (4, 5) +Mine hit at position (1, 5) Board overview - - - - - -- - 1 1 1 -- - 1 * 1 -- - 1 1 1 - - - - - +- - - 1 1 +- - - 1 D +- - - 1 1 diff --git a/assignment-1.5-arrays-pointers-files/minesweeper/obj/minesweeper.o b/assignment-1.5-arrays-pointers-files/minesweeper/obj/minesweeper.o Binary files differ. diff --git a/assignment-1.5-arrays-pointers-files/minesweeper/obj/settings.o b/assignment-1.5-arrays-pointers-files/minesweeper/obj/settings.o Binary files differ. diff --git a/assignment-1.5-arrays-pointers-files/minesweeper/src/gameplay.c b/assignment-1.5-arrays-pointers-files/minesweeper/src/gameplay.c @@ -67,4 +67,4 @@ void reveal(WINDOW *gameWin, char **dispboard, int chCol, int chRow) { mvwaddch(gameWin, chRow+1, chCol+1, dispboard[chCol][chRow]); wrefresh(gameWin); -}- \ No newline at end of file +} diff --git a/assignment-1.5-arrays-pointers-files/minesweeper/src/main.c b/assignment-1.5-arrays-pointers-files/minesweeper/src/main.c @@ -2,9 +2,9 @@ int main(int argc, char **argv) { - main_win(); - start(); - endwin(); + main_win(); + start(); + endwin(); - return 0; -}- \ No newline at end of file + return 0; +} diff --git a/assignment-1.5-arrays-pointers-files/minesweeper/src/minesweeper.c b/assignment-1.5-arrays-pointers-files/minesweeper/src/minesweeper.c @@ -1,19 +1,5 @@ #include "minesweeper.h" -void main_win() -{ - initscr(); - noecho(); - cbreak(); - - WINDOW *mainWin = newwin(0, 0, 0, 0); - box(mainWin, 0, 0); - refresh(); - wrefresh(mainWin); - keypad(mainWin, true); -} - - void start() { int yMax, xMax; @@ -181,4 +167,4 @@ void fill_spaces(char **mineboard, int COLS, int ROWS, int NMINES) for (j = 0; j < ROWS; j++) if (mineboard[i][j] != MINE && mineboard[i][j] == '0') mineboard[i][j] = '-'; -}- \ No newline at end of file +} diff --git a/assignment-1.5-arrays-pointers-files/minesweeper/src/settings.c b/assignment-1.5-arrays-pointers-files/minesweeper/src/settings.c @@ -1,5 +1,19 @@ #include "settings.h" +void main_win() +{ + initscr(); + noecho(); + cbreak(); + + WINDOW *mainWin = newwin(0, 0, 0, 0); + box(mainWin, 0, 0); + refresh(); + wrefresh(mainWin); + keypad(mainWin, true); +} + + void set_mode(WINDOW *menuWin) // loop { char mode;