|
|
@ -26,6 +26,26 @@ void ask_lab_dimensions(unsigned short *len_x, unsigned short *len_y){ |
|
|
|
*len_y = get_natural_number("Bitte gib die y-Laenge des Labyrinthes an:\n"); |
|
|
|
} |
|
|
|
|
|
|
|
short wall(unsigned short *x, unsigned short *y, unsigned short len_x, unsigned short len_y){ |
|
|
|
char answer; |
|
|
|
printf("Moechten Sie die Koordinaten einer weiteren Labyrinthwand angeben? (y/n)\n"); |
|
|
|
scanf(" %c", &answer); |
|
|
|
|
|
|
|
if (answer == 'n'){ |
|
|
|
return 1; |
|
|
|
} |
|
|
|
|
|
|
|
printf("Bitte geben Sie die Koordinaten von Labyrinthwaenden im Format x, y ein.\n"); |
|
|
|
scanf("%hu, %hu", x, y); |
|
|
|
|
|
|
|
if (*x >= len_x || *y >= len_y){ |
|
|
|
printf("Die eingegebenen Koordinaten sind zu gross.\n"); |
|
|
|
return -1; |
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
void turn_direction_right(Direction *direction){ |
|
|
|
switch (*direction) { |
|
|
|
case N: |
|
|
|