diff --git a/src/main/c/labyrinth.c b/src/main/c/labyrinth.c index a83f54d..221e0f7 100644 --- a/src/main/c/labyrinth.c +++ b/src/main/c/labyrinth.c @@ -161,8 +161,28 @@ short calculate_lab_way(Field_State** field, unsigned short len_x, unsigned shor void labyrinth(){ unsigned short len_x, len_y; + Field_State **f; ask_lab_dimensions(&len_x, &len_y); + f = malloc(len_x * sizeof *f); + for (int c_index = 0; c_index < len_x; c_index++){ + f[c_index] = malloc(len_y * sizeof f[c_index]); + } + + ask_lab_walls(f, len_x, len_y); + + if (calculate_lab_way(f, len_x, len_y, 0, 0) == 1){ + printf("Keine Loesung moeglich!\n"); + } + + show_solution(f, len_x, len_y); + + for (int c_index = 0; c_index < len_x; c_index++) + { + free(f[c_index]); + } + free(f); + }