|
|
@ -5,6 +5,15 @@ |
|
|
|
#include "stdio.h" |
|
|
|
#include "stdlib.h" |
|
|
|
|
|
|
|
void show_solution(Field_State** field, unsigned short len_x, unsigned short len_y){ |
|
|
|
for (int c_x = 0; c_x < len_x; c_x++){ |
|
|
|
for (int c_y = 0; c_y < len_y; c_y++){ |
|
|
|
printf("%hi", field[c_x][c_y]); |
|
|
|
} |
|
|
|
printf("\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void turn_direction_right(Direction *direction){ |
|
|
|
switch (*direction) { |
|
|
|
case N: |
|
|
@ -66,9 +75,6 @@ short lab_can_move(Field_State** field, unsigned short x, unsigned short y, Dire |
|
|
|
} |
|
|
|
if (field[x][y] == WALL){ |
|
|
|
return 1; |
|
|
|
} |
|
|
|
if (direction == N && field[x][y] == SOLUTION){ |
|
|
|
return 1; |
|
|
|
} |
|
|
|
if (field[x][y] == SOLUTION){ |
|
|
|
return 1; |
|
|
|