bfs #19
@ -121,7 +121,7 @@ def go(row, column, direction):
|
|||||||
|
|
||||||
|
|
||||||
def is_valid_move(map, target_row, target_column):
|
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 True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user