|
@ -56,7 +56,7 @@ void init_field(Field_State** field, unsigned short len_x, unsigned short len_y) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
short lab_can_move(Field_State** field, unsigned short x, unsigned short y, Direction direction, unsigned short len_x, unsigned short len_y){ |
|
|
short lab_can_move(Field_State** field, unsigned short x, unsigned short y, Direction direction, unsigned short len_x, unsigned short len_y){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lab_move(&x, &y, direction); |
|
|
lab_move(&x, &y, direction); |
|
|
if (x >= len_x){ |
|
|
if (x >= len_x){ |
|
|
return 1; |
|
|
return 1; |
|
@ -64,6 +64,9 @@ short lab_can_move(Field_State** field, unsigned short x, unsigned short y, Dire |
|
|
if (y >= len_y){ |
|
|
if (y >= len_y){ |
|
|
return 1; |
|
|
return 1; |
|
|
} |
|
|
} |
|
|
|
|
|
if (direction == N && field[x][y] == WALL){ |
|
|
|
|
|
return 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|