Browse Source

refactoring: lab_can_move

remotes/origin/Joe
Joe Lukas Kalb 11 months ago
parent
commit
5b28c39baa
  1. 11
      src/main/c/labyrinth.c
  2. 8
      src/test/c/test_labyrinth.c

11
src/main/c/labyrinth.c

@ -64,16 +64,7 @@ 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;
}
if (direction == E && field[x][y] == WALL){
return 1;
}
if (direction == S && field[x][y] == WALL){
return 1;
}
if (direction == W && field[x][y] == WALL){
if (field[x][y] == WALL){
return 1; return 1;
} }

8
src/test/c/test_labyrinth.c

@ -607,11 +607,3 @@ void test_lab_can_move_at_1_1_direction_W_target_WALL_expected_1(void)
free(field); free(field);
} }
Loading…
Cancel
Save