diff --git a/algorithms/bfs.py b/algorithms/bfs.py index 94b150f..2e76d45 100644 --- a/algorithms/bfs.py +++ b/algorithms/bfs.py @@ -121,7 +121,7 @@ def go(row, column, direction): def is_valid_move(map, target_row, target_column): - if 0 <= target_row < ROWS and 0 <= target_column < COLUMNS: + if 0 <= target_row < ROWS and 0 <= target_column < COLUMNS and map[target_row][target_column] == ' ': return True return False