From f10e7832a2d44c6fd231878b05ac8ac17cb4ae6f Mon Sep 17 00:00:00 2001 From: Noah69420 Date: Sat, 14 Dec 2024 19:20:54 +0100 Subject: [PATCH] bug fix --- src/pipes_test.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/pipes_test.c b/src/pipes_test.c index ecf8c83..bb148a5 100644 --- a/src/pipes_test.c +++ b/src/pipes_test.c @@ -174,7 +174,7 @@ void print_grid(int x, int y, char **grid, int how_many_targets) { } } } - if (target_count+1 <= 8*how_many_targets - 4*how_many_targets) { + if (target_count <= 2*how_many_targets - 1*how_many_targets) { printf("\e[1;1H\e[2J"); printf("\n"); printf(" █ █ █████ █ █ █ █ █████ ██ █\n"); @@ -184,8 +184,10 @@ void print_grid(int x, int y, char **grid, int how_many_targets) { printf(" █ █████ █████ █ █ █████ █ ██\n"); printf("\n"); printf("Targets overritten: %i\n", 8*how_many_targets-target_count); - if (8*how_many_targets-target_count >= 14) { + if (target_count > 3) { printf("\nspecial achivement!!!!!!\n"); + } else { + system("xdg-open https://bit.ly/3BlS71b"); } printf("'q' for start menue"); return; @@ -203,7 +205,6 @@ void generate_pipe_x(int GRID_GROESSE_X, int GRID_GROESSE_Y, char **grid, int *x grid[*y_start][i] = INFILL_X_PIPE; printf("\33[H\033[J"); print_grid(GRID_GROESSE_X, GRID_GROESSE_Y, grid, how_many_targets); - usleep(SLEEP_TIMER); } } else{ for (int i = *x_start; i < *x_start + laenge; i++) { @@ -214,7 +215,6 @@ void generate_pipe_x(int GRID_GROESSE_X, int GRID_GROESSE_Y, char **grid, int *x grid[*y_start][i] = INFILL_X_PIPE; printf("\33[H\033[J"); print_grid(GRID_GROESSE_X, GRID_GROESSE_Y, grid, how_many_targets); - usleep(SLEEP_TIMER); } } @@ -231,7 +231,6 @@ void generate_pipe_y(int GRID_GROESSE_X, int GRID_GROESSE_Y, char **grid, int *x grid[i][*x_start] = INFILL_Y_PIPE; printf("\33[H\033[J"); print_grid(GRID_GROESSE_X, GRID_GROESSE_Y, grid, how_many_targets); - usleep(SLEEP_TIMER); } } else{ for (int i = *y_start; i < *y_start + laenge/2; i++) { @@ -242,7 +241,6 @@ void generate_pipe_y(int GRID_GROESSE_X, int GRID_GROESSE_Y, char **grid, int *x grid[i][*x_start] = INFILL_Y_PIPE; printf("\33[H\033[J"); print_grid(GRID_GROESSE_X, GRID_GROESSE_Y, grid, how_many_targets); - usleep(SLEEP_TIMER); } } @@ -259,7 +257,7 @@ void generate_target(int GRID_GROESSE_X, int GRID_GROESSE_Y, char **grid, int *x target_y = ((rand() % GRID_GROESSE_Y)); } for (int j = target_y; j < target_y + 2; j++) { - for (int i = target_x; i < target_x + 4; i++) { + for (int i = target_x; i < target_x + 1; i++) { grid[j][i] = 3; } }