added collision to bfs;
This commit is contained in:
parent
57cdb87820
commit
88297d0b9b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user