From 2302392b0cef6822231b61c518ce91f43f2705c7 Mon Sep 17 00:00:00 2001 From: Joe Lukas Kalb Date: Tue, 6 Feb 2024 19:24:57 +0100 Subject: [PATCH] refactoring: lab_can_move --- src/main/c/labyrinth.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/c/labyrinth.c b/src/main/c/labyrinth.c index 53bf12d..09e00a1 100644 --- a/src/main/c/labyrinth.c +++ b/src/main/c/labyrinth.c @@ -70,13 +70,7 @@ short lab_can_move(Field_State** field, unsigned short x, unsigned short y, Dire if (direction == N && field[x][y] == SOLUTION){ return 1; } - if (direction == E && field[x][y] == SOLUTION){ - return 1; - } - if (direction == S && field[x][y] == SOLUTION){ - return 1; - } - if (direction == W && field[x][y] == SOLUTION){ + if (field[x][y] == SOLUTION){ return 1; }