Browse Source

ask_lab_walls

main^2
Joe Lukas Kalb 11 months ago
committed by Peter Wiebe
parent
commit
8084d5da9c
  1. 15
      src/main/c/labyrinth.c
  2. 1
      src/main/c/labyrinth.h

15
src/main/c/labyrinth.c

@ -115,3 +115,18 @@ short lab_can_move(Field_State** field, unsigned short x, unsigned short y, Dire
return 0;
}
void ask_lab_walls(Field_State** field, unsigned short len_x, unsigned short len_y){
unsigned short x, y;
short a;
init_field(field, len_x, len_y);
do {
a = get_wall_input(&x, &y, len_x, len_y);
if (a == 0){
set_wall(field, x, y);
show_solution(field, len_x, len_y);
}
} while (a != 1);
}

1
src/main/c/labyrinth.h

@ -12,5 +12,6 @@ void show_solution(Field_State** field, unsigned short len_x, unsigned short len
unsigned short get_natural_number(char text[]);
void ask_lab_dimensions(unsigned short *len_x, unsigned short *len_y);
short get_wall_input(unsigned short *x, unsigned short *y, unsigned short len_x, unsigned short len_y);
void ask_lab_walls(Field_State** field, unsigned short len_x, unsigned short len_y);
#endif // TEST_H
Loading…
Cancel
Save