From 88e5d40db3b9a5ee87ee734d22847029f28a104a Mon Sep 17 00:00:00 2001 From: MuedeHydra Date: Fri, 13 Dec 2024 18:26:13 +0100 Subject: [PATCH] windows fix --- src/main.c | 5 +++-- src/pipes2.c | 11 ----------- src/pipes_test.c | 3 ++- src/pipes_test.h | 10 ++++++++++ 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/main.c b/src/main.c index 088ca11..0207fe8 100644 --- a/src/main.c +++ b/src/main.c @@ -31,10 +31,10 @@ Datum: 04.12.2024 #endif // import sub programme -// #include "pipes_test.h" #include "Ramen_Physik.h" #include "test_prog.h" +#include "pipes_test.h" #include "pipes2.h" @@ -357,7 +357,8 @@ int main(int argc, char **argv){ case 'q': run = false; break; case '?': print_help(); break; - case 'p': pipes_2(width, height); break; + case 'p': pipes(width, height); break; + case 'P': pipes_2(width, height); break; // windows case -32:{ diff --git a/src/pipes2.c b/src/pipes2.c index aad87ff..e45d6b7 100644 --- a/src/pipes2.c +++ b/src/pipes2.c @@ -52,17 +52,6 @@ void print_at(int x, int y, char c[4]) printf("\033[%d;%dH%s", y, x, c); } -void print_grid(char **grid){ - - for (int i = 0; i < GRID_GROESSE_Y; i++) { - for (int j = 0; j < GRID_GROESSE_X; j++) { - printf("%i", grid[i][j]); - // printf(" "); - } - printf("\n"); - } -} - char print_pipe(int *x, int *y, int x_max, int y_max, int length, char direction, char direction_old){ bool start = true; for(int i = 0; i < length; i++){ diff --git a/src/pipes_test.c b/src/pipes_test.c index 8037e48..8ba4d50 100644 --- a/src/pipes_test.c +++ b/src/pipes_test.c @@ -21,7 +21,8 @@ //#define GRID_GROESSE_Y 60 #define MIN_LAENGE_PIPE 6 #define MAX_LAENGE_PIPE 6 -#define SLEEP_TIMER 5000 // in nano seconds +#define SLEEP_TIMER 0 // in nano seconds +// #define SLEEP_TIMER 5000 // in nano seconds #define COLOR_CHANGING_PROBABILITY 5 // format: "(1 : your_number)", for every direction change #define RESET_COLOR "\033[0m" diff --git a/src/pipes_test.h b/src/pipes_test.h index d8ee3af..7b5e6e9 100644 --- a/src/pipes_test.h +++ b/src/pipes_test.h @@ -1 +1,11 @@ +#ifndef pipes_test_H_ +#define pipes_test_H_ + +// #ifndef _FILE_NAME_H_ +// #define _FILE_NAME_H_ + +// extern int pipes(int width, int height); +// int pipes_2(int width, int height); int pipes(int GRIG_GROESSE_X, int GRID_GROESSE_Y); + +#endif