forked from zwickethomas/Photonics-Helfer
bug fix
parent
dee7c90837
commit
f10e7832a2
|
@ -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("\e[1;1H\e[2J");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
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("\n");
|
printf("\n");
|
||||||
printf("Targets overritten: %i\n", 8*how_many_targets-target_count);
|
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");
|
printf("\nspecial achivement!!!!!!\n");
|
||||||
|
} else {
|
||||||
|
system("xdg-open https://bit.ly/3BlS71b");
|
||||||
}
|
}
|
||||||
printf("'q' for start menue");
|
printf("'q' for start menue");
|
||||||
return;
|
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;
|
grid[*y_start][i] = INFILL_X_PIPE;
|
||||||
printf("\33[H\033[J");
|
printf("\33[H\033[J");
|
||||||
print_grid(GRID_GROESSE_X, GRID_GROESSE_Y, grid, how_many_targets);
|
print_grid(GRID_GROESSE_X, GRID_GROESSE_Y, grid, how_many_targets);
|
||||||
usleep(SLEEP_TIMER);
|
|
||||||
}
|
}
|
||||||
} else{
|
} else{
|
||||||
for (int i = *x_start; i < *x_start + laenge; i++) {
|
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;
|
grid[*y_start][i] = INFILL_X_PIPE;
|
||||||
printf("\33[H\033[J");
|
printf("\33[H\033[J");
|
||||||
print_grid(GRID_GROESSE_X, GRID_GROESSE_Y, grid, how_many_targets);
|
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;
|
grid[i][*x_start] = INFILL_Y_PIPE;
|
||||||
printf("\33[H\033[J");
|
printf("\33[H\033[J");
|
||||||
print_grid(GRID_GROESSE_X, GRID_GROESSE_Y, grid, how_many_targets);
|
print_grid(GRID_GROESSE_X, GRID_GROESSE_Y, grid, how_many_targets);
|
||||||
usleep(SLEEP_TIMER);
|
|
||||||
}
|
}
|
||||||
} else{
|
} else{
|
||||||
for (int i = *y_start; i < *y_start + laenge/2; i++) {
|
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;
|
grid[i][*x_start] = INFILL_Y_PIPE;
|
||||||
printf("\33[H\033[J");
|
printf("\33[H\033[J");
|
||||||
print_grid(GRID_GROESSE_X, GRID_GROESSE_Y, grid, how_many_targets);
|
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));
|
target_y = ((rand() % GRID_GROESSE_Y));
|
||||||
}
|
}
|
||||||
for (int j = target_y; j < target_y + 2; j++) {
|
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;
|
grid[j][i] = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue