added collision to bfs;

This commit is contained in:
Angelika Iskra 2022-04-11 12:08:03 +02:00
parent 57cdb87820
commit 88297d0b9b

View File

@ -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