uni

University stuff
git clone git://git.christosmarg.xyz/uni-assignments.git
Log | Files | Refs | README | LICENSE

commit 78e56c73c8185c0d69584439439a41a6e764b976
parent 017412953745cc8be6f0605b59dc0a6af8ffd202
Author: Christos Margiolis <christos@margiolis.net>
Date:   Sat, 11 Jan 2020 01:37:44 +0200

draft commit (#1)

Diffstat:
Aassignment-1.5-arrays-pointers-files/combinations/data.txt | 0
Aassignment-1.5-arrays-pointers-files/combinations/include/ccolors.h | 32++++++++++++++++++++++++++++++++
Massignment-1.5-arrays-pointers-files/combinations/include/combinations.h | 16+++++++++-------
Massignment-1.5-arrays-pointers-files/combinations/src/combinations.c | 95+++++++++++++++++++++++++++++++++++++------------------------------------------
Massignment-1.5-arrays-pointers-files/combinations/src/main.c | 10+++++-----
Aassignment-1.5-arrays-pointers-files/fcombinations/Makefile | 32++++++++++++++++++++++++++++++++
Aassignment-1.5-arrays-pointers-files/fcombinations/data.txt | 0
Aassignment-1.5-arrays-pointers-files/fcombinations/include/ccolors.h | 32++++++++++++++++++++++++++++++++
Aassignment-1.5-arrays-pointers-files/fcombinations/include/combinations.h | 33+++++++++++++++++++++++++++++++++
Aassignment-1.5-arrays-pointers-files/fcombinations/src/combinations.c | 244+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aassignment-1.5-arrays-pointers-files/fcombinations/src/main.c | 16++++++++++++++++
Massignment-1.5-arrays-pointers-files/minesweeper/include/minesweeper.h | 13++++++++-----
Dassignment-1.5-arrays-pointers-files/minesweeper/minesweeper | 0
Dassignment-1.5-arrays-pointers-files/minesweeper/obj/main.o | 0
Dassignment-1.5-arrays-pointers-files/minesweeper/obj/minesweeper.o | 0
Massignment-1.5-arrays-pointers-files/minesweeper/src/minesweeper.c | 81++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------
Massignment-1.5-arrays-pointers-files/minesweeper/todo.md | 47+++++++++++++++--------------------------------
Aassignment-1.5-arrays-pointers-files/notes.md | 10++++++++++
18 files changed, 541 insertions(+), 120 deletions(-)

diff --git a/assignment-1.5-arrays-pointers-files/combinations/data.txt b/assignment-1.5-arrays-pointers-files/combinations/data.txt diff --git a/assignment-1.5-arrays-pointers-files/combinations/include/ccolors.h b/assignment-1.5-arrays-pointers-files/combinations/include/ccolors.h @@ -0,0 +1,31 @@ +#ifndef C_COLORS_H +#define C_COLORS_H + +#include <stdio.h> + +enum options {RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, BOLD_RED, BOLD_GREEN, BOLD_YELLOW, BOLD_BLUE, BOLD_MAGENTA, BOLD_CYAN, STANDARD}; +enum options color; + +void set_color(enum options color) +{ + switch (color) + { + case RED: printf("\033[0;31m"); break; + case GREEN: printf("\033[0;32m"); break; + case YELLOW: printf("\033[0;33m"); break; + case BLUE: printf("\033[0;34m"); break; + case MAGENTA: printf("\033[0;35m"); break; + case CYAN: printf("\033[0;36m"); break; + + case BOLD_RED: printf("\033[1;31m"); break; + case BOLD_GREEN: printf("\033[1;32m"); break; + case BOLD_YELLOW: printf("\033[1;33m"); break; + case BOLD_BLUE: printf("\033[1;34m"); break; + case BOLD_MAGENTA: printf("\033[1;35m"); break; + case BOLD_CYAN: printf("\033[1;36m"); break; + + case STANDARD: printf("\033[0m"); break; + } +} + +#endif+ \ No newline at end of file diff --git a/assignment-1.5-arrays-pointers-files/combinations/include/combinations.h b/assignment-1.5-arrays-pointers-files/combinations/include/combinations.h @@ -3,9 +3,11 @@ #include <stdbool.h> -int get_val(const char *); +int get_n(); +int get_k(); int *fill_array(int); bool exists_in_array(int *, int, int); +int *sort(int *); void x_pair(int *, int *); void y_pair(int *, int *); @@ -15,15 +17,15 @@ int even_calc(int *); bool belongs_x(int, int, int); int sum_calc(int *); bool belongs_y(int, int, int); -void print_combs(); +void print_combs(int *); int combinations_count(int); int factorial(int); int sum_comb_calc(); -int not_printed(); -float frequency(); -char *get_filename(); -bool is_subset(); -void read_file(char *); +void print(); +int not_printed(); +int not_first_condition(); +int not_second_condition_only(); +int frequency(); #endif diff --git a/assignment-1.5-arrays-pointers-files/combinations/src/combinations.c b/assignment-1.5-arrays-pointers-files/combinations/src/combinations.c @@ -3,21 +3,36 @@ #include <stdbool.h> #include <string.h> #include "combinations.h" +#include "ccolors.h" #define COMBSN 6 -int get_val(const char *varName) +int get_n() { - int num; + int N; do { - printf("%s (6 < N <= 49): ", varName); - scanf("%d", &num); - } while (num <= 6 || num > 49); + printf("N (6 < N <= 49): "); + scanf("%d", &N); + } while (N <= 6 || N > 49); - return num; + return N; +} + + +int get_k(int N) +{ + int K; + + do + { + printf("N (6 < N <= 49): "); + scanf("%d", &K); + } while (K > N || K < 0); + + return K; } @@ -29,8 +44,10 @@ int *fill_array(int N) if (arr == NULL) { - printf("Not enough memory, error.\n"); - exit(1); + set_color(BOLD_RED); + printf("Error! Not enough memory, exiting...\n"); + set_color(STANDARD); + exit(EXIT_FAILURE); } else { @@ -81,6 +98,12 @@ bool exists_in_array(int *arr, int N, int num) } +int *sort(int *arr) +{ + +} + + void x_pair(int *x1, int *x2) { do @@ -116,9 +139,6 @@ void combinations(int *arr, int x1, int x2, int y1, int y2) temp = *(arr + j); *(arr + j) = *(arr + j + 1); *(arr + j + 1) = temp; - - if (belongs_x(even_calc(arr), x1, x2) && belongs_y(even_calc(arr), x1, x2)) - print_combs(arr); } } } @@ -126,44 +146,25 @@ void combinations(int *arr, int x1, int x2, int y1, int y2) int even_calc(int *arr) { - int i, numEven; - - for (i = 0; i < COMBSN; i++) - { - if (*(arr + i) % 2 == 0) - numEven++; - } - return numEven; } bool belongs_x(int numEven, int x1, int x2) { - if (numEven >= x1 && numEven <= x2) - return true; - else - return false; + } int sum_calc(int *arr) { - int i, sum = 0; - for (i = 0; i < COMBSN; i++) - sum += *(arr + i); - - return sum; } bool belongs_y(int sumNums, int y1, int y2) { - if (sumNums >= y1 && sumNums <= y2) - return true; - else - return false; + } @@ -172,16 +173,23 @@ void print_combs(int *arr) int i; for (i = 0; i < COMBSN; i++) - printf("%d", *(arr + i)); + printf("%d ", *(arr + i)); printf("\n"); } +void print(int N) +{ + +} + + + int combinations_count(int N) { int numCombinations; - numCombinations = factorial(N) / (factorial(6) * factorial(N - 6)); + numCombinations = factorial(N) / (factorial(COMBSN) * factorial(N - COMBSN)); return numCombinations; } @@ -210,32 +218,19 @@ int not_printed() } -float frequency() +int not_first_condition() { } -char *get_filename() +int not_second_condition_only() { - char buffer[1000]; - char *fileName; - fgets(buffer, 1000, stdin); - fileName = (char *)malloc(strlen(buffer) + 1); - strcpy(fileName, buffer); - - return fileName; } -bool is_subset() +int frequency() { -} - - -void read_file(char *fileName) -{ - } \ No newline at end of file diff --git a/assignment-1.5-arrays-pointers-files/combinations/src/main.c b/assignment-1.5-arrays-pointers-files/combinations/src/main.c @@ -8,16 +8,16 @@ int main(int argc, char **argv) int N, K; int *arr; int x1, x2, y1, y2; + char *fileName; - N = get_val("N"); - K = get_val("K"); + N = get_n(); + K = get_k(N); arr = fill_array(N); - x_pair(&x1, &x2); + x_pair(&x1, &x2); y_pair(&y1, &y2); - combinations(arr, x1, x2, y1, y2); - + combinations(arr, x1, x2, y1, y2); free(arr); return 0; diff --git a/assignment-1.5-arrays-pointers-files/fcombinations/Makefile b/assignment-1.5-arrays-pointers-files/fcombinations/Makefile @@ -0,0 +1,31 @@ +EXEC = combs + +SRC_DIR = src +OBJ_DIR = obj + +SRC = $(wildcard $(SRC_DIR)/*.c) +OBJ = $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o) + +MKDIR_P = mkdir -p + +CPPFLAGS += -Iinclude +CFLAGS += -Wall +LDFLAGS += -Llib +LDLIBS += -lm + +.PHONY: all clean + +all: $(EXEC) + +$(EXEC): $(OBJ) + $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ + +$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c + $(MKDIR_P) $(OBJ_DIR) + $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ + +run: + ./$(EXEC) ${ARGS} + +clean: + $(RM) $(OBJ) $(EXEC)+ \ No newline at end of file diff --git a/assignment-1.5-arrays-pointers-files/fcombinations/data.txt b/assignment-1.5-arrays-pointers-files/fcombinations/data.txt diff --git a/assignment-1.5-arrays-pointers-files/fcombinations/include/ccolors.h b/assignment-1.5-arrays-pointers-files/fcombinations/include/ccolors.h @@ -0,0 +1,31 @@ +#ifndef C_COLORS_H +#define C_COLORS_H + +#include <stdio.h> + +enum options {RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, BOLD_RED, BOLD_GREEN, BOLD_YELLOW, BOLD_BLUE, BOLD_MAGENTA, BOLD_CYAN, STANDARD}; +enum options color; + +void set_color(enum options color) +{ + switch (color) + { + case RED: printf("\033[0;31m"); break; + case GREEN: printf("\033[0;32m"); break; + case YELLOW: printf("\033[0;33m"); break; + case BLUE: printf("\033[0;34m"); break; + case MAGENTA: printf("\033[0;35m"); break; + case CYAN: printf("\033[0;36m"); break; + + case BOLD_RED: printf("\033[1;31m"); break; + case BOLD_GREEN: printf("\033[1;32m"); break; + case BOLD_YELLOW: printf("\033[1;33m"); break; + case BOLD_BLUE: printf("\033[1;34m"); break; + case BOLD_MAGENTA: printf("\033[1;35m"); break; + case BOLD_CYAN: printf("\033[1;36m"); break; + + case STANDARD: printf("\033[0m"); break; + } +} + +#endif+ \ No newline at end of file diff --git a/assignment-1.5-arrays-pointers-files/fcombinations/include/combinations.h b/assignment-1.5-arrays-pointers-files/fcombinations/include/combinations.h @@ -0,0 +1,33 @@ +#ifndef COMBINATIONS_H +#define COMBINATIONS_H + +#include <stdbool.h> + +void read_file(); + +int get_n(); +int get_k(); +int *fill_array(int); +bool exists_in_array(int *, int, int); +int *sort(int *); + +void x_pair(int *, int *); +void y_pair(int *, int *); + +void combinations(int *, int, int, int, int); +int even_calc(int *); +bool belongs_x(int, int, int); +int sum_calc(int *); +bool belongs_y(int, int, int); +void print_combs(int *); +int combinations_count(int); +int factorial(int); +int sum_comb_calc(); + +void print(); +int not_printed(); +int not_first_condition(); +int not_second_condition_only(); +int frequency(); + +#endif diff --git a/assignment-1.5-arrays-pointers-files/fcombinations/src/combinations.c b/assignment-1.5-arrays-pointers-files/fcombinations/src/combinations.c @@ -0,0 +1,243 @@ +#include <stdio.h> +#include <stdlib.h> +#include <stdbool.h> +#include <string.h> +#include "combinations.h" +#include "ccolors.h" + +#define COMBSN 6 + + +void read_file(char **argv) +{ + FILE *dataFile = fopen(argv[1], "r"); + + if (dataFile == NULL) + { + set_color(BOLD_RED); + printf("Error opening the file, exiting...\n"); + set_color(STANDARD); + exit(EXIT_FAILURE); + } + else + { + printf("Cool\n"); + // fscanf(); + } + + fclose(dataFile); +} + + +int get_k(int N) +{ + int K; + + do + { + printf("N (6 < N <= 49): "); + scanf("%d", &K); + } while (K > N || K < 0); + + return K; +} + + +int *fill_array(int N) +{ + int *arr, num, i = 0; + + arr = (int *)malloc(N * sizeof(int)); + + if (arr == NULL) + { + set_color(BOLD_RED); + printf("Error! Not enough memory, exiting...\n"); + set_color(STANDARD); + exit(EXIT_FAILURE); + } + else + { + do + { + printf("arr[%d]: ", i); + scanf("%d", &num); + + if (num >= 1 && num <= 49) + { + if (i == 0) + { + *(arr + i) = num; + i++; + } + else + { + if (!exists_in_array(arr, N, num)) + { + *(arr + i) = num; + i++; + } + else + printf("Give a different number.\n"); + } + } + else + printf("Give a number in [1, 49].\n"); + + } while (i < N); + } + + return arr; +} + + +bool exists_in_array(int *arr, int N, int num) +{ + int *arrEnd = arr + N - 1; + + while (arr <= arrEnd && *arr != num) + arr++; + + if (arr <= arrEnd) + return true; + else + return false; +} + + +int *sort(int *arr) +{ + +} + + +void x_pair(int *x1, int *x2) +{ + do + { + printf("x1: "); + scanf("%d", x1); + printf("x2: "); + scanf("%d", x2); + } while (*x1 < 0 || *x1 > *x2 || *x2 > 6); // 0 ≤ Χ1 ≤ Χ2 ≤ 6 +} + + +void y_pair(int *y1, int *y2) +{ + do + { + printf("y1: "); + scanf("%d", y1); + printf("y2: "); + scanf("%d", y2); + } while (*y1 < 21 || *y1 > *y2 || *y2 > 279); // 21 ≤ Υ1 ≤ Υ2 ≤ 279 +} + + +void combinations(int *arr, int x1, int x2, int y1, int y2) +{ + int i, j, temp; + + for (i = 1; i <= COMBSN; i++) + { + for (j = 0; j < COMBSN-1; j++) + { + temp = *(arr + j); + *(arr + j) = *(arr + j + 1); + *(arr + j + 1) = temp; + } + } +} + + +int even_calc(int *arr) +{ + +} + + +bool belongs_x(int numEven, int x1, int x2) +{ + +} + + +int sum_calc(int *arr) +{ + +} + + +bool belongs_y(int sumNums, int y1, int y2) +{ + +} + + +void print_combs(int *arr) +{ + int i; + + for (i = 0; i < COMBSN; i++) + printf("%d ", *(arr + i)); + printf("\n"); +} + + +void print(int N) +{ + +} + + + +int combinations_count(int N) +{ + int numCombinations; + + numCombinations = factorial(N) / (factorial(COMBSN) * factorial(N - COMBSN)); + + return numCombinations; +} + + +int factorial(int num) +{ + int i, fac; + + for (i = 1, fac = 1; i <= num; i++) + fac *= i; + + return fac; +} + + +int sum_comb_calc() +{ + +} + + +int not_printed() +{ + +} + + +int not_first_condition() +{ + +} + + +int not_second_condition_only() +{ + +} + + +int frequency() +{ + +}+ \ No newline at end of file diff --git a/assignment-1.5-arrays-pointers-files/fcombinations/src/main.c b/assignment-1.5-arrays-pointers-files/fcombinations/src/main.c @@ -0,0 +1,16 @@ +#include <stdio.h> +#include <stdlib.h> +#include "combinations.h" + + +int main(int argc, char **argv) +{ + int N, K; + int *arr; + int x1, x2, y1, y2; + char *fileName; + + read_file(argv); + + return 0; +} diff --git a/assignment-1.5-arrays-pointers-files/minesweeper/include/minesweeper.h b/assignment-1.5-arrays-pointers-files/minesweeper/include/minesweeper.h @@ -9,26 +9,29 @@ #include <stdbool.h> +#define MINE '*' + void main_win(); void start(); +void set_mode(struct _win_st*); int set_width(struct _win_st*, int); int set_height(struct _win_st*, int); -int set_minesnum(struct _win_st*, int); +int set_nmines(struct _win_st*, int); void game_win(int, int, int); void init_dispboard(struct _win_st*, int, int); void fill_dispboard(char **, int, int); - void init_mineboard(struct _win_st*, int, int, int); void place_mines(char **, int, int, int); -void adj_mines(char **, int, int); +int adj_mines(char **, int, int); void fill_spaces(char **, int, int, int); -bool is_mine(char **, int, int); +void selection(); void transfer(char **, char **, int, int); -void reveal(struct _win_st*, char **, int, int); +void reveal(struct _win_st*, char **, char **, int, int); +bool is_mine(char **, int, int); void game_over(struct _win_st*); void print(struct _win_st*, char **, int, int); diff --git a/assignment-1.5-arrays-pointers-files/minesweeper/minesweeper b/assignment-1.5-arrays-pointers-files/minesweeper/minesweeper Binary files differ. diff --git a/assignment-1.5-arrays-pointers-files/minesweeper/obj/main.o b/assignment-1.5-arrays-pointers-files/minesweeper/obj/main.o Binary files differ. 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/src/minesweeper.c b/assignment-1.5-arrays-pointers-files/minesweeper/src/minesweeper.c @@ -23,15 +23,44 @@ void start() wrefresh(menuWin); keypad(menuWin, true); + //set_mode(menuWin); + int WIDTH = set_width(menuWin, xMax); int HEIGHT = set_height(menuWin, yMax); - int MINES = set_minesnum(menuWin, WIDTH * HEIGHT); + int NMINES = set_nmines(menuWin, WIDTH * HEIGHT); - game_win(WIDTH, HEIGHT, MINES); + game_win(WIDTH, HEIGHT, NMINES); getchar(); } +void set_mode(WINDOW *menuWin) +{ + char mode; + mvwprintw(menuWin, 1, 1, "Keyboard or text mode (k/t): "); + wrefresh(menuWin); + scanw("%c", &mode); + mvwprintw(menuWin, 1, strlen("Keyboard or text mode (k/t): ") + 1, "%c", mode); + wrefresh(menuWin); + + switch (mode) // clear contents first + { + case 'k': + case 'K': + mvwprintw(menuWin, 2, 1, "Keyboard mode"); + wrefresh(menuWin); + break; + case 't': + case 'T': + mvwprintw(menuWin, 2, 1, "Text mode"); + wrefresh(menuWin); + break; + default: + break; + } +} + + int set_width(WINDOW *menuWin, int xMax) { int WIDTH; @@ -66,24 +95,24 @@ int set_height(WINDOW *menuWin, int yMax) } -int set_minesnum(WINDOW *menuWin, int DIMENSIONS) +int set_nmines(WINDOW *menuWin, int DIMENSIONS) { - int MINES; + int NMINES; do { mvwprintw(menuWin, 3, 1, "Mines: "); wrefresh(menuWin); - scanw("%d", &MINES); - mvwprintw(menuWin, 3, strlen("Mines: ") + 1, "%d", MINES); + scanw("%d", &NMINES); + mvwprintw(menuWin, 3, strlen("Mines: ") + 1, "%d", NMINES); wrefresh(menuWin); - } while (MINES < 1 || MINES > DIMENSIONS); + } while (NMINES < 1 || NMINES > DIMENSIONS); - return MINES; + return NMINES; } -void game_win(int WIDTH, int HEIGHT, int MINES) +void game_win(int WIDTH, int HEIGHT, int NMINES) { int yMax, xMax; getmaxyx(stdscr, yMax, xMax); @@ -95,7 +124,7 @@ void game_win(int WIDTH, int HEIGHT, int MINES) keypad(gameWin, true); init_dispboard(gameWin, WIDTH, HEIGHT); - init_mineboard(gameWin, WIDTH, HEIGHT, MINES); + init_mineboard(gameWin, WIDTH, HEIGHT, NMINES); } @@ -123,16 +152,15 @@ void fill_dispboard(char **dispboard, int WIDTH, int HEIGHT) } -void init_mineboard(WINDOW *gameWin, int WIDTH, int HEIGHT, int MINES) +void init_mineboard(WINDOW *gameWin, int WIDTH, int HEIGHT, int NMINES) { int i; char **mineboard = (char **)malloc(WIDTH * sizeof(char *)); for (i = 0; i < WIDTH; i++) *(mineboard + i) = (char *)malloc(HEIGHT); - fill_spaces(mineboard, WIDTH, HEIGHT, MINES); - place_mines(mineboard, WIDTH, HEIGHT, MINES); - adj_mines(mineboard, WIDTH, HEIGHT); + fill_spaces(mineboard, WIDTH, HEIGHT, NMINES); + place_mines(mineboard, WIDTH, HEIGHT, NMINES); print(gameWin, mineboard, WIDTH, HEIGHT); @@ -140,17 +168,17 @@ void init_mineboard(WINDOW *gameWin, int WIDTH, int HEIGHT, int MINES) } -void place_mines(char **mineboard, int WIDTH, int HEIGHT, int MINES) +void place_mines(char **mineboard, int WIDTH, int HEIGHT, int NMINES) { int i, wRand, hRand; srand(time(NULL)); - for (i = 0; i < MINES; i++) + for (i = 0; i < NMINES; i++) { wRand = rand() % WIDTH; hRand = rand() % HEIGHT; - *(*(mineboard + wRand) + hRand) = '*'; + *(*(mineboard + wRand) + hRand) = MINE; } } @@ -172,7 +200,7 @@ void place_mines(char **mineboard, int WIDTH, int HEIGHT, int MINES) [x-1, y+1][x, y+1][x+1, y+1] */ -void adj_mines(char **mineboard, int WIDTH, int HEIGHT) +int adj_mines(char **mineboard, int WIDTH, int HEIGHT) { int row, col, numAdj = 0; @@ -180,15 +208,26 @@ void adj_mines(char **mineboard, int WIDTH, int HEIGHT) { for (col = 1; col <= HEIGHT; col++) { - if (*(*(mineboard + (row - 1)) + col) != '*') + if + ( + (*(*(mineboard + (row - 1)) + col) != MINE) || // North + (*(*(mineboard + (row + 1)) + col) != MINE) || // South + (*(*(mineboard + (row)) + col + 1) != MINE) || // East + (*(*(mineboard + (row)) + col - 1) != MINE) || // West + (*(*(mineboard + (row - 1)) + col + 1) != MINE) || // North-East + (*(*(mineboard + (row - 1)) + col - 1) != MINE) || // North-West + (*(*(mineboard + (row + 1)) + col + 1) != MINE) || // South-East + (*(*(mineboard + (row - 1)) + col - 1) != MINE) // South-West + ) numAdj++; } } + return numAdj; } -void fill_spaces(char **mineboard, int WIDTH, int HEIGHT, int MINES) +void fill_spaces(char **mineboard, int WIDTH, int HEIGHT, int NMINES) { int i, j; @@ -196,7 +235,7 @@ void fill_spaces(char **mineboard, int WIDTH, int HEIGHT, int MINES) { for (j = 0; j < HEIGHT; j++) { - if ((*(*mineboard + i) + j) != '*') + if ((*(*mineboard + i) + j) != MINE) *(*(mineboard + i) + j) = '-'; } } diff --git a/assignment-1.5-arrays-pointers-files/minesweeper/todo.md b/assignment-1.5-arrays-pointers-files/minesweeper/todo.md @@ -1,35 +1,18 @@ -// Variables - -// Create world - - // Define M and N - // Malloc world array - // Fill array - -// Create stats board - -// Place mines - // rand - // Directions - -// system("clear||cls") -// Print world - -// Game logic - - // Show stats - // Show mines - -// Game over menu - - // Press key to continue - -// Export to text - - // Get file name - // Write to file - -// free() +* limits +* resizing +* ```fill_adj()``` +* ```selection()``` +* ```transfer()``` +* ```reveal()``` +* ```is_mine()``` +* ```game_over()``` +* Game over menu + * Press key to continue + +* Export to text + + * Get file name + * Write to file ```c pin = (char **)malloc(M*sizeof(char *)); diff --git a/assignment-1.5-arrays-pointers-files/notes.md b/assignment-1.5-arrays-pointers-files/notes.md @@ -0,0 +1,9 @@ +* quick sort +* seperate comb sources (file & manual) +* write to file minesweeper +* multiple txt (and 49 nums) +* 6 for +* meter function +* kcombinations +* combinations all in one with menu (6, k, file) +* < >+ \ No newline at end of file